'Failed to unlink socket file" error in MongoDB 3.0

后端 未结 8 1551
独厮守ぢ
独厮守ぢ 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条回答
  •  Happy的楠姐
    2020-11-28 05:57

    For UNIX-based operating systems, as an alternative to the answer provided by Bastronaut, you could also specify the .sock file to be saved to a folder over which mongod has full user rights (corresponding to the way you are running mongod), that way mongod will also be able to remove the .sock file upon shutdown. The default folder to which the .sock file is saved is '/tmp'. To specify another folder, use a custom mongodb configuration file, for instance 'mongodb.conf', and add the following to it:

    net:
      unixDomainSocket:
        pathPrefix: "anotherFolder"
    

    After which you can run mongod with the command:

    $ mongod --config /path/to/mongodb.conf
    

    You can read the documentation on: https://docs.mongodb.org/manual/reference/configuration-options/#net.unixDomainSocket.pathPrefix

提交回复
热议问题