我安装了 Ubuntu Server 16.04.1 LTS,过去 5 天一直遇到问题。输入以下命令后,其中一个问题如下:mongo
Server has startup warnings:
2016-12-19T08:40:14.039-0800 I STORAGE [initandlisten]
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten]
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten]
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten]
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten]
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-12-19T08:40:15.984-0800 I CONTROL [initandlisten]
我是 Ubuntu 新手,希望得到一步步的解决方案
答案1
您有两个问题需要处理:
您尚未配置安全功能在你的mongodb:
- 按照官方步骤操作这里
禁用透明大页面(THP):
有两个选择这里,看看第二个答案,但如果接受的答案对你有用:
/etc/rc.local
在文件之前添加以下内容出口 0if test -f /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; then echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag fi 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
编辑
/etc/default/grub
:- 追加
transparent_hugepage=never
到GRUB_CMDLINE_LINUX_DEFAULT
然后 - 跑步
update-grub
- 追加
资料来源:
如何修改“/sys/kernel/mm/transparent_hugepage/enabled”
https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/#transparent-huge-pages-thp-settings
https://www.mongodb.com/blog/post/mongodb-security-part-ii-10-mistakes-that-can