mongoDB配置问题--mongo shell 警告

#shell连接mongoDB之后给如下警告
MongoDB shell version: 3.0.2
connecting to: test
Server has startup warnings: 
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] 
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] 
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] 
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 30543 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
2015-04-22T09:59:51.085+0800 I CONTROL [initandlisten]
-虽然不影响学习但是由于本菜的强迫症.....
#解决方法(其实本菜完全不知道这是在干嘛)
前两个警告:root权限下
# echo never >/sys/kernel/mm/transparent_hugepage/enabled
# echo never >/sys/kernel/mm/transparent_hugepage/defrag
第三个警告:
在/etc/security/limits.d/下修改文件99-mongodb-nproc.conf(如果没有则新建文件) 添加内容:
#mongodb set limits config
*  -  fsize        unlimited   # (file size)
*  -  cpu         unlimited   # (cpu time)
*  -  as           unlimited   # (virtual memory size)
*  -  nofile     64000        # (open files)
*  -  nproc     64000        # (processes/threads)
然后重启mongoDB再进入mongo shell警告消失

你可能感兴趣的:(MongoDB学习笔记)