incapaz de conectar mongodb

0

quando estou tentando executar 'sudo service mongo start' então a saída é 'Falha ao iniciar o mongod.service: Unidade mongod.service não encontrado'.

a saída do mongo é -:

x2@jj2:~$ mongo
MongoDB shell version: 3.0.15
connecting to: test
2017-07-24T12:59:56.386+0530 W NETWORK  Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2017-07-24T12:59:56.388+0530 E QUERY    Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
    at connect (src/mongo/shell/mongo.js:179:14)
    at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed

e o status é: -

x2@jj2:~$ sudo service mongodb status
● mongodb.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: 
   Active: failed (Result: exit-code) since Mon 2017-07-24 13:06:05 IST; 9min ag
  Process: 29210 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (co
 Main PID: 29210 (code=exited, status=1/FAILURE)

Jul 24 13:06:05 x2 systemd[1]: Started High-performance, schema-free docu
Jul 24 13:06:05 x2 systemd[1]: mongodb.service: Main process exited, code
Jul 24 13:06:05 x2 systemd[1]: mongodb.service: Unit entered failed state
Jul 24 13:06:05 x2 systemd[1]: mongodb.service: Failed with result 'exit-
    
por danish 24.07.2017 / 09:50

1 resposta

0

Você tem:

Active: failed (Result: exit-code) since Mon 2017-07-24 13:06:05 IST; 9min ag

Falha significa que você não está executando, portanto, está recebendo:

Failed to connect to 127.0.0.1:27017...

tente executar:

sudo service mongodb restart
    
por Piotr Stawiski 24.07.2017 / 11:15