Connection Refused to Mongodb Errno 111

Connection refused to MongoDB errno 111

Thanks for the help everyone!

Turns out that it was an iptable conflict. Two rules listing the port open (which resulted in a closed port).

However, one of the comments by aka and another by manu2013 were problems that I would have run into, if not for the conflict.

So! Always remember to edit the /etc/mongod.conf file and set your bind_ip = 0.0.0.0 in order to make connections externally.

Also, make sure that you don't have conflicting rules in your iptable for the port mongo wants (see link on mongodb's site to set up your iptables properly).

Connection refused [Errno 111] when trying to access to MongoDB with Docker

According to the Compose file, your Mongo host is called mongo, not mongodb. Try

db = MongoClient('mongo:27017/').mydatabase

maybe?

Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

thank you everyone I tried running mongo it was not running finally I found there was no space in my hard disc I emptied some of the space and finally re installed it the same installation procedure as followed to install as given in mongodb docs finally restarted the server and it is running.

https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu

mongoDB Error: pymongo.errors.Server.SelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

No running process was bound to port 27017. Fixed.

Mongodb won't start - reason: errno:111 Connection refused

It seems that your error is similar to this

Removing the /tmp/mongodb-27017.sock file should do the trick.

Also check your disk space, as it seems the process is not starting because you are missing space for the journal files (check @dave-v comment below)



Related Topics



Leave a reply



Submit