1, vi /etc/yum.repos.d/mongodb-org-3.2.repo
2, 添加如下内容
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
3,安装mongodb
yum -y install mongodb-org
4,修改配置文件
将bindIp:后面的内容去掉(绑定的ip)
5,修改内核参数
# echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
# echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
6,修改文件描述符
vim /etc/security/limits.conf
添加如下内容:
mongod soft nofile 64000
mongod hard nofile 64000
mongod soft nproc 32000
mongod hard nproc 32000
7,启动mongodb服务
/etc/init.d/mongd start
时间: 2024-12-16 18:47:48