标签:
[root@localhost ~]# vim /etc/yum.repos.d/mongdb-org-3.0.repo //ADD [mongodb-org-3.0] name=MongoDB Repository baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/ gpgcheck=0 enabled=1 [root@localhost ~]# yum install mongodb-org
//mongodb配置文件 --> /etc/mongod.conf //mongodb日志文件 --> /var/log/mongodb/mongod.log //mongodb启动脚本 --> /etc/init.d/mongod
//mongodb对应的数据库文件
--> /var/lib/mongo/
[root@localhost ~]# vim /etc/mongd.conf //Delete ... ... # location of pidfile # fork and run in background ... //Change绑定ip bindIp: {将后面的所有都删除} --> 代表绑定所有的ip [root@localhost ~]# /etc/init.d/mongod start
[root@localhost ~]# ls /var/lib/mongo/
journal local.0 local.ns mongod.lock storage.bson _tmp
//启动mongodb前的准备 1. 与内核相关的配置 [root@localhost ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled [root@localhost ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag 2.修改系统的一些限制数 [root@localhost ~]# vim /etc/security/limits.conf //在最尾处加入 mongod soft nofile 64000 mongod hard nofile 64000 mongod soft nproc 32000 mongod hard nproc 32000
标签:
原文地址:http://www.cnblogs.com/frankielf0921/p/5449279.html