[[email protected] ~]# 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 [[email protected] ~]# yum install mongodb-org
//mongodb配置文件 --> /etc/mongod.conf //mongodb日志文件 --> /var/log/mongodb/mongod.log //mongodb启动脚本 --> /etc/init.d/mongod //mongodb对应的数据库文件 --> /var/lib/mongo/
[[email protected] ~]# vim /etc/mongd.conf //Delete ... ... # location of pidfile # fork and run in background ... //Change绑定ip bindIp: {将后面的所有都删除} --> 代表绑定所有的ip [[email protected] ~]# /etc/init.d/mongod start
[[email protected] ~]# ls /var/lib/mongo/journal local.0 local.ns mongod.lock storage.bson _tmp
//启动mongodb前的准备 1. 与内核相关的配置 [[email protected] ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled [[email protected] ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag 2.修改系统的一些限制数 [[email protected] ~]# vim /etc/security/limits.conf //在最尾处加入 mongod soft nofile 64000 mongod hard nofile 64000 mongod soft nproc 32000 mongod hard nproc 32000
时间: 2024-10-03 04:27:22