1.服务器:
192.168.9.103 cluster-1
192.168.9.104 cluster-2
192.168.9.105 cluster-3
2.部署mongodb
[[email protected] ~]# tar xvf mongodb-linux-x86_64-rhel70-4.0.3.tgz
[[email protected] ~]# mkdir /app
[[email protected] ~]# mv mongodb-linux-x86_64-rhel70-4.0.3 /app/mongodb
[[email protected] mongodb]# mkdir db logs
[[email protected] mongodb]# cat > /app/mongodb/mongdb.conf << EOF
> systemLog:
> destination: file
> path: /app/mongodb/logs/mongodb.log
> logAppend: true
> net:
> port: 27013
> bindIp: 192.168.9.105
> storage:
> dbPath: /app/mongodb/db
> directoryPerDB: true
> processManagement:
> fork: true
> pidFilePath: /app/mongodb/mongodb.pid
> replication:
> replSetName: panp
> oplogSizeMB: 10240
> EOF
3.修改内核参数
[[email protected] mongodb]# echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
[[email protected] mongodb]# echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
[[email protected] mongodb]# vim /etc/security/limits.conf
添加一下几行
mongod soft nofile 64000
mongod hard nofile 64000
mongod soft nproc 32000
mongod hard nproc 32000
原文地址:http://blog.51cto.com/13893093/2300895
时间: 2024-10-12 12:02:30