Mongo server problem when restarting mongo process

The Mongo process is started by a regular user, then the server reboots. After rebooting the server, when you tried to start mongod with the same right to obtain user permission. I checked in the log file, the username was changed to root.

Error message

Claim: 28595: 13: throwing exception exceptions in initAndListen: 28595 13: Permission denied, terminating dbexit: rc: 100

In the log file

1 root      root      256 WiredtigerLog4.log
1 mongodb   mongodb   256 WiredtigerLog3.log
1 mongodb   mongodb   256 WiredtigerLog2.log
1 mongodb   mongodb   256 WiredtigerLog1.log

My question is How did the username change to root

+4
source share
1 answer

. , mongo mongod.

delete pid from /var/run/mongodb/mongoX.pid
chown -R mongod:mongod /<mongodatadirectory>/
chmod 775 -R /<mongodatadirectory>/

mongod restart\sysvinit

+1

Source: https://habr.com/ru/post/1613614/


All Articles