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

來源:互聯網
上載者:User

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/enabledfiif test -f /sys/kernel/mm/transparent_hugepage/defrag; then   echo never > /sys/kernel/mm/transparent_hugepage/defragfi

然後重啟mongod服務

deng@deng-Lenovo:~$ sudo service mongod restartmongod stop/waitingmongod start/running, process 26127deng@deng-Lenovo:~$ mongoMongoDB shell version: 3.0.4connecting to: test> 



相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.