System Environment
Distributor Id:centos
Description: CentOS Release 6.7 (Final)
release: 6.7
codename: Final
Problem Description
Error after installing MongoDB on the system.
(Installation Tutorial Address: https://docs.mongodb.com/master/tutorial/install-mongodb-on-red-hat/)
Error message:
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 '
WARNING: soft rlimits too low. Rlimits set to 1024x768 processes, 65535 files. Number of processes should is at least 32767.5:0.5 times number of files.
As shown in figure:
Solution Solutions first two warning
sudo echo "never" >/sys/kernel/mm/transparent_hugepage/enabled
sudo echo "never" > /sys/kernel/mm/ Transparent_hugepage/defrag
a third warning
Vim/etc/security/limits.conf
Add a few lines
mongod soft nofile 64000
mongod Hard Nofile 64000
mongod soft nproc 32000
mongod hard nproc 32000
Restart Mongod
sudo service mongod restart
Success
After the restart success, all the errors are gone, as follows
➜ ~ git: (master) MONGO
MongoDB shell version:3.2.6
connecting to:test
>