标签:mongodb kernel linux ubuntu server
启动mongodb时提示下方信息
Server has startup warnings: 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten] 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten] 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never' 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten]
只需打开/etc/init/mongod.conf
文件,将下方的代码添加到chown $DEAMONUSER /var/run/mongodb.pid
和
end script
.之间即可,注意空格的对齐。
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi
deng@deng-Lenovo:~$ sudo service mongod restart mongod stop/waiting mongod start/running, process 26127 deng@deng-Lenovo:~$ mongo MongoDB shell version: 3.0.4 connecting to: test >
I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
标签:mongodb kernel linux ubuntu server
原文地址:http://blog.csdn.net/djd1234567/article/details/46550443