MongoDB error:CONTROL [initandlisten] ** WARNING: You are running this process as the root user,…
有时候,你在使用MongoDB的时候,可能会遇到如题所示的告警,它的详细呈现如下所示:
代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
PS C:\Adamhuan_App_Center\Green_Tool\MongoDB\bin> .\mongo.exe 192.168.136.131:27017 2015-07-12T13:02:07.663+0800 I CONTROL Hotfix KB2731284 or later update is not installed, will zero-out data files MongoDB shell version: 3.0.4 connecting to: 192.168.136.131:27017/test Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user Server has startup warnings: 2015-07-03T16:03:26.880+0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended. 2015-07-03T16:03:26.880+0800 I CONTROL [initandlisten] > > exit bye PS C:\Adamhuan_App_Center\Green_Tool\MongoDB\bin> |
该告警之所以产生的原因是:在Linux上,你使用root身份执行的“mongod”进程,而MongDB建议使用非root用户执行。
如下所示:
(以“root”执行)
(以非“root”执行)