1. 程式人生 > >服務器搭建與管理(8)

服務器搭建與管理(8)

host hugepage tran dir enable roo pro uri RoCE

1.服務器:

192.168.9.103 cluster-1
192.168.9.104 cluster-2
192.168.9.105 cluster-3

2.部署mongodb

[root@localhost ~]# tar xvf mongodb-linux-x86_64-rhel70-4.0.3.tgz
[root@localhost ~]# mkdir /app
[root@localhost ~]# mv mongodb-linux-x86_64-rhel70-4.0.3 /app/mongodb
[root@localhost mongodb]# mkdir db logs
[root@localhost 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.修改內核參數

[root@localhost mongodb]# echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
[root@localhost mongodb]# echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
[root@localhost mongodb]# vim /etc/security/limits.conf
添加一下幾行
mongod  soft  nofile  64000
mongod  hard  nofile  64000
mongod  soft  nproc  32000
mongod  hard  nproc  32000

服務器搭建與管理(8)