1. Server:
192.168.9.103 cluster-1192.168.9.104 cluster-2192.168.9.105 cluster-3
2. Deploying 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. Modifying kernel parameters
[[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 64000mongod hard nofile 64000mongod soft nproc 32000mongod hard nproc 32000
Server Building and Management (8)