Experimente estes passos:
-
Remover o arquivo de bloqueio:
sudo rm /var/lib/mongodb/mongod.lock
-
Repare o mongodb:
mongod –repair
-
Inicie o mongodb:
sudo systemctl start mongodb
-
Inicie o cliente mongo:
mongo
Fonte:
Ao executar o comando mongo no terminal
MongoDB shell version v3.4.10
connecting to: mongodb://127.0.0.1:27017
2017-11-15T14:47:49.452+0530 W NETWORK [thread1] Failed to connect to
127.0.0.1:27017, in(checking socket for error after poll), reason:
Connection refused
2017-11-15T14:47:49.495+0530 E QUERY [thread1] Error: couldn't
connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed
Experimente estes passos:
Remover o arquivo de bloqueio:
sudo rm /var/lib/mongodb/mongod.lock
Repare o mongodb:
mongod –repair
Inicie o mongodb:
sudo systemctl start mongodb
Inicie o cliente mongo:
mongo
Fonte: