我刚刚安装了一台全新的Centos 7操作系统
Linux version 3.10.0-229.1.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Fri Mar 27 03:04:26 UTC 2015
我安装了MongoDB 3.0,但连接时出现了奇怪的消息:
2015-04-15T07:48:55.583+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-04-15T07:48:55.583+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-04-15T07:48:55.583+0000 I CONTROL [initandlisten]
2015-04-15T07:48:55.583+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-04-15T07:48:55.583+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
我该如何在此版本中禁用THP?
我尝试了以下方法,但都没有成功
我可以通过运行以下命令来禁用它:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
但是当我重新启动后,问题又出现了。
我尝试修改/etc/rc.local文件并添加以下内容:
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
exit 0
我尝试重新启动但没有结果。
我还尝试修改 /etc/default/grub ...