1、** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
** We suggest setting it to ‘never’
** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
** We suggest setting it to ‘never’
临时解决方案: echo "never" > /sys/kernel/mm/transparent_hugepage/enabled echo "never" > /sys/kernel/mm/transparent_hugepage/defrag systemctl restart mongod 永久解决方案:(此中方案仅能使/sys/kernel/mm/transparent_hugepage/enabled生效) # vim /etc/default/grub GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never" # grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-109209786e3a48efae39e12ae1c8e74c Found initrd image: /boot/initramfs-0-rescue-109209786e3a48efae39e12ae1c8e74c.img done #reboot 重启 推荐使用方案 - 永久解决: 官方教程:https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/ 参考 Init Script 部分
2、** WARNING: soft rlimits too low. rlimits set to 4096 processes, 65536 files. Number of processes should be at least 32768 : 0.5 times number of files.
参考官方的解决方法:https://docs.mongodb.com/manual/reference/ulimit/
# vim /etc/security/limits.d/20-nproc.conf * soft nofile 524288 * hard nofile 524288 * soft nproc 524288 * hard nproc 524288 * soft fsize unlimited * hard fsize unlimited * soft cpu unlimited * hard cpu unlimited * soft as unlimited * hard as unlimited
3、mongod关机后,无法启动
#删除lock文件,创建pid的运行目录 rm -f /data/mongod/mongod.lock mkdir -p /run/mongod/chown mongod:mongod /run/mongod
4、mongod启动
about to fork child process, waiting until server is ready for connections.
forked process: 4113
ERROR: child process failed, exited with error number 14
查看日志文件发现: [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted rm -f /tmp/mongodb-27017.sock
Pingback引用通告: Mongodb的安装和启动 | 精彩每一天