欢迎投稿

今日深度:

I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transp

I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.,transparenthugepage


启动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.pidend 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

然后重启mongod服务

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
> 



www.htsjk.Com true http://www.htsjk.com/shujukunews/8844.html NewsArticle I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is always.,transparenthugepage 启动mongodb时提示下方信息 Server has startup warnings: 2015-06-18T17:20:17.944+0800 I CONTROL [initandlisten] 2015-0...
评论暂时关闭