2

I am new to MongoDB and I keep getting a SocketException and a shutting down with exit code : 1 error. I have also tried stopping and restarting the mongod servers. The error I get is as follows :

root@sam-sepiol:~# mongo
MongoDB shell version v4.2.8
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-07-01T08:19:45.406-0400 E  QUERY    [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-07-01T08:19:45.407-0400 F  -        [main] exception: connect failed
2020-07-01T08:19:45.407-0400 E  -        [main] exiting with code 1

  • 1
    `Connection refused` means the operating system actively refused the connection because no process is listening on port 27017. – Joe Jul 02 '20 at 05:09
  • Refer the below link for the answer, this question has already been answered: https://stackoverflow.com/a/17793856/10404589 – Afroz Chakure Aug 22 '20 at 17:55

0 Answers0