'Failed to unlink socket file" error in MongoDB 3.0

后端 未结 8 1573
独厮守ぢ
独厮守ぢ 2020-11-28 05:14

I am new to MongoDB. I am trying to install MongoDb 3.0 on Ubuntu 13.0 LTS, which is a VM on Windows 7 Host. I have installed MongoDB successfully (packages etc.), but when

8条回答
  •  囚心锁ツ
    2020-11-28 06:04

    The most likely cause for this was that the mongod process was at some point started by the root user. The socket file (/tmp/mongodb-27017.sock) was therefore owned by the root user. The mongod process usually runs under its own dedicated user, and that user did not have the permissions to delete that file.

    The solution, as you already found out, was to delete it. Then mongodb was able to recreate it with the correct permissions. This should persist after reboot, as long as mongodb is started using the init scripts, or under the correct user account.

提交回复
热议问题