I CONTROL [initandlisten] ** WARNING:/sys/kernel/mm/transparent_hugepage/enabled is 'alway'., transparenthugepage
The following message is prompted when mongodb is started.
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]
Open/etc/init/mongod.conf
File to add the code belowchown $DEAMONUSER /var/run/mongodb.pid
Andend script
., Pay attention to the alignment of spaces.
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
Restart the mongod service.
deng@deng-Lenovo:~$ sudo service mongod restartmongod stop/waitingmongod start/running, process 26127deng@deng-Lenovo:~$ mongoMongoDB shell version: 3.0.4connecting to: test>