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
Is There Any API For Determining the Physical Address from Virtual Address in Linux
How to Set the Working Directory of the Parent Process
How to Use Local Docker Images With Minikube
More Elegant "Ps Aux | Grep -V Grep"
How to Show All Shared Libraries Used by Executables in Linux
How to Permanently Export a Variable in Linux
What Is Better "Int 0X80" or "Syscall" in 32-Bit Code on Linux
Calling Printf in X86_64 Using Gnu Assembler
What Are the Return Values of System Calls in Assembly
How to Redirect Output of Systemd Service to a File
Forward Host Port to Docker Container
How to Run a Shell Script When a File or Directory Changes
Why Does a Jvm Report More Committed Memory Than the Linux Process Resident Set Size
How to Permanently Set $Path on Linux/Unix