form1.cn
Make a little progress every day

消除Mongo启动时的警告

27th of March 2017 Database Mongodb 3075

1,never警告

2017-03-27T13:56:24.343+0800 I CONTROL  [initandlisten] * WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-03-27T13:56:24.343+0800 I CONTROL  [initandlisten] *        We suggest setting it to 'never'
2017-03-27T13:56:24.343+0800 I CONTROL  [initandlisten] 
2017-03-27T13:56:24.343+0800 I CONTROL  [initandlisten] * WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-03-27T13:56:24.343+0800 I CONTROL  [initandlisten] *        We suggest setting it to 'never'


解决方法

sudo echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
sudo echo "never" >  /sys/kernel/mm/transparent_hugepage/defrag


2,其它警告

2017-03-27T14:36:09.489+0800 I STORAGE  [initandlisten] * WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-03-27T14:36:09.489+0800 I STORAGE  [initandlisten] *          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-03-27T14:36:11.865+0800 I CONTROL  [initandlisten] 
2017-03-27T14:36:11.865+0800 I CONTROL  [initandlisten] * WARNING: Access control is not enabled for the database.
2017-03-27T14:36:11.865+0800 I CONTROL  [initandlisten] *          Read and write access to data and configuration is unrestricted.
2017-03-27T14:36:11.865+0800 I CONTROL  [initandlisten] * WARNING: You are running this process as the root user, which is not recommended.


解决方法

配置一个MongoDB用户