#Here's the environment:
1. Linux(x64): **16.04**
2. MongoDB: **3.2.15**
#Error:
root@system-test:~# mongo
MongoDB shell version: 3.2.15
connecting to: test
2017-07-25T07:31:28.528+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2017-07-25T07:31:28.530+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:229:14
@(connect):1:6
exception: connect failed
root@system-test:~#
**When I tried to see the status I get this:**
root@system-test:~# sudo service mongodb status
● mongodb.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongodb.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-07-25 07:45:32 UTC; 1min 8s ago
Process: 1721 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=14)
Main PID: 1721 (code=exited, status=14)
Jul 25 07:45:32 system-test systemd: Started High-performance, schema-free document-oriented database.
Jul 25 07:45:32 system-test systemd: mongodb.service: Main process exited, code=exited, status=14/n/a
Jul 25 07:45:32 system-test systemd: mongodb.service: Unit entered failed state.
Jul 25 07:45:32 system-test systemd: mongodb.service: Failed with result 'exit-code'.
#How it happened:
I tried to stop MongoDB and did the following
**
sudo service mongo stop
** [This didn't work].
Then i tried **kill - 2
** [Seem didn't worked too]
But after this command **#mongo
** stopped working and getting the above error.
Please help guys
Asked by Siddhartha Chowdhury
(131 rep)
Jul 25, 2017, 07:59 AM
Last activity: Aug 17, 2023, 09:57 AM
Last activity: Aug 17, 2023, 09:57 AM