I am trying to start mongod. I run "sudo service mongod start", but I get:
`Failed to unlink socket file /tmp/mongodb-27017.sock Unknown error Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 685
`
Theres a question here but I have tried all solutions to no avail
Os : ubuntu 16.04 When I run "ls -lsah /tmp/mongodb-27017.sock" I see:
0 srwx------ 1 mongodb mongodb 0 Jun 14 11:45 /tmp/mongodb-27017.sock
Then I run
sudo service mongod start
When I run "ls -lsah /tmp/mongodb-27017.sock" again, I see:
0 srwx------ 1 mongodb mongodb 0 Jun 14 11:45 /tmp/mongodb-27017.sock
Then I run "mongod", It given same error
I had the same problem and noticed this old answer: https://stackoverflow.com/a/34290982/2683681 .
You can use their command:
sudo chown `whoami` /tmp/mongodb-27017.sock
But if you're using root then you'd better be doing:
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock
My problem stemmed from the fact that root owned the socket.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.