0

I recently updated my MongoDB server from 3.2 to 3.6 to fix some errors with naming. When I had my Mongo server as 3.2 it did work fine.

I downloaded the MongoDB 3.6 from https://www.mongodb.com/download-center/community and installed it with the package manager (sudo dpkg -i mongodb-org-server_3.6.12_amd64.deb) and I have verified that the server did update with mongod --version.

As far as I know, starting the system works, but when I run mongo, or sudo mongo, it gives me the following output

MongoDB shell version: 3.2.22
connecting to: test
2019-05-14T13:28:09.049-0400 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2019-05-14T13:28:09.049-0400 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

I'm not sure how I could fix the problem either, I have tried to restart the service and restarting the server it's running on (Ubuntu 16.04) and neither worked. Nothing I found online could help either so if you know a possible solution, please let me know, thanks!

Steven Webster
  • 308
  • 3
  • 11
  • Possible duplicate of [Connection refused to MongoDB errno 111](https://stackoverflow.com/questions/24899849/connection-refused-to-mongodb-errno-111) – Rohit Sawant May 14 '19 at 17:43
  • 1
    Update your question with logs from the mongodb server. the error message given in the question talks only about the error when trying to connect to the server. – Mani May 14 '19 at 18:45
  • None of the solutions on the other one helped the one that did downgraded my mongodb to 2.6 which is the opposite of what I wanted. My `/var/log/mongodb` is empty and contains no logs to give. When I added a specific log path, the file was still empty after running `mongod` – Steven Webster May 15 '19 at 16:45

1 Answers1

0

Before that, try with

sudo service mongod stop
sudo rm /var/lib/mongodb/mongod.lock
mongod –repair
sudo service mongod start
MauriRamone
  • 469
  • 1
  • 3
  • 21