Pymongo keeps refusing the connection at 27017
Removing mongod.lock
inside /var/lib/mongodb
sudo rm /var/lib/mongodb/mongod.lock
And then restarting the service should do it. For example, in my Ubuntu installation, restarting the server is something like this:
sudo service mongodb start
mongo - couldn't connect to server 127.0.0.1:27017
This error is what you would see if the mongo shell was not able to talk to the mongod server.
This could be because the address was wrong (host or IP) or that it was not running. One thing to note is the log trace provided does not cover the "Fri Nov 9 16:44:06" of your mongo timestamp
.
Can you:
- Provide the command line arguments (if any) used to start your
mongod process - Provide the log file activity from the mongod startup as well as
logs during the mongo shell startup attempt? - Confirm that your mongod process is being started on the same
machine as the mongo shell?
Django - MongoDB: (could not connect to localhost:27017) Connection refused
Did you setup MongoDB separately? The howto you link doesn't seem to go over the MongoDB configuration. It assumes the database is already running. In any case MongoDB seems down, or is at least listening somewhere else.
The last error ("...instance of int") is just because you specified '27017'
(a string) instead of 27017
in the configuration dictionary. But even then it should be equivalent to the first, simpler configuration.
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
Related Topics
Python/Selenium Incognito/Private Mode
How to Return a Subset of a List That Matches a Condition
Web Scraping Dynamic Content with Python
How to Run Python Script on Terminal
Python 2.7:Write to File Instantly
Why Does Pandas Apply Calculate Twice
Read a File Line by Line from S3 Using Boto
Set Up Python Simplehttpserver on Windows
Download File Using Partial Download (Http)
How to Select Rows with One or More Nulls from a Pandas Dataframe Without Listing Columns Explicitly
Which Version of Python Do I Have Installed
Add Column with Constant Value to Pandas Dataframe
Interact with Other Programs Using Python