I'm getting the following error:
This is what happens when I try to start mongodb:
When connecting to HipChat Server with the Windows HipChat 4.0 client, after providing your login details, HipChat tries to connect but fails with an error stating, 'Something's Gone Terribly Wrong,'. Windows 4.0 does not respect the proxy exception list set in Windows proxy setting. Client failed to connect to the server with error 'HipChat Server not.
I already tried mongo --repair
I made chown and chmod to var, lib, and data/db and log mongodb.
Not sure what else to do. Any suggestions?
mongodb.log:
EDIT:
I removed the lock then did mongod repair and got this error:
so I did it with sudo:
But still having the same problem.
The log indicates that mongodb is terminating because there is an old lock file.
If you are not and were not running with journaling, remove the lock file, run repair, and start mongodb again.
If you are or were running with journaling turned on, see the relevant Mongo DB docs. Note that they say 'If you are running with Journaling you should not do a repair to recover to a consistent state.' So if you were journaling, the repair may have made things worse.
Did you run mongod
before running mongo
?
I followed installation instructions for mongodb from http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/ and I had the same error as you only when I ran mongo
before actually running the mongo process with mongod
. I thought installing mongodb would also launch it but you need to launch it manually with mongod
before you do anything else that needs mongodb.
This it's because the mongod process it's down, you must to run the commands bellow in order to get up the mongod process:
Hope this helps you.
Check your filesystem free space and increase it if its less. This also could cause the mongo not to start. Check the /var/log/mongodb/mongodb.log file.
Try running mongod
before mongo
.
sudo /usr/sbin/mongod
on my opensuse
This solved my problem,
so first you have to remove the mongod.lock file by below command
and then restart the mongo service by issuing below command
You can check with netstat -anp grep 27017
to see if the port is in use by another process.
In windows run cmd as Admin:
Create directory:
mkdir c:mongodatadb
Install service:
mongod.exe --install --logpath c:mongologs --logappend --bind_ip 127.0.0.1 --dbpath c:mongodatadb --directoryperdb
Start MongoDB:
net start MongoDB
4.Start Mongo Shell:
This solution work fine for me
For future reference,Follow these steps to avoid similar errors:
1.Download MondoDBhttps://www.mongodb.com/
2.Open a terminal and cd into your downloads folder or whatever folder youve saved your mondodb download(Ensure you extract your mongodb folder before you cd into it)
3.Move mongodb to your usr/local path
4.cd into your local folder
5.make a new directory
6.cd into the new directory just created above
7.give mongo permisions
8.Then go/open your .bash_profile
To do so,follow these steps:
In your a new terminal
1.cd
2.pwd
3.ls -l
Check if the .bash_profile appears on your list of files on your terminal
if not create the -bash_profile
Creating .bash_profile:
In your terminal
touch .bash_profile
//skip this step if you already have a .bash_profile
Step8:
Nextin your terminal:
And in your bash file that pops open add the following:
And then save.(File Save or command S/CMD+S)
Step9:back in your terminal:
Now open two terminals.One will for your mondo daemon the other for your mongo.
Terminal 1:in your terminal type:mongod
Output:
Terminal 2:
Output:
Also make sure you dont make the following typo error when starting your mongod in your terminal:This is incorrect
gives off the following error: Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
This is Correct:
(There should be no space between the words mongo and d..mondod
Finally always keep in mind that you have to run mondod before you run mongo on your terminals.
I followed the doc at http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/.
After configured and reboot, I executed sudo service mongod start
and got ... [FAILED]
.
At last, I found that mongod
had started. I think the yum install
added it to auto start.
To check if your mongod
is running: service mongod status
.
Hope this can help someone has same problem.
After frequent attempt finally I got to troubleshoot the problem...
This error could be caused by the MongoDB's bind IP setting. You can check MongoDB's config file by
In my case, the bind IP is set to server's intranet address, just as following:
So I have give mongo an IP parameter to connect to shell by type:
Don't forget to restart mongodb service if you changed the config.
I have mongo version 3.2.1 and had to delete the lock file from /data/db/
and after this, ran mongod
and it started successfully.
After removing mongod.lock which was inside the data directory in my windows OS,it was still showing the same error message. I had to run mongod with --dbpath to make the mongo command run without errors.
Although the answers are received, I would wish to discuss about network errors in MongoDB
.
Setting the safe write concerns is not the full proof method to make sure that we're safe. Let's assume that w=1
& j=true
are set, what if the write acknowledgement didn't received from the server? Well, the likelyhood is it didn't happened, but it might have happened. The reason why this might have happened is that there are network errors - there are reasons that we may not receive an affirmative response. So, we can send the request from the application through a driver of language of choice. mongod
can complete it successfully and then there could be a TCP reset, and the network actually can get reset in a way that we never receive response. So, we could get an error and on the error, we might assume that we got an error. It didn't happened, but it may happen.
For an insert, it's possible to guard against it. It's possible because if we let the driver create the _id
and we do an insert - then we could do that insert multiple times and it would be any harm. Because, if we do this 1st time and we get an error and we're not sure whether or not that insert completed because it's a network error, then we could just do it again. And provided we perform it again, tyr to perform it with the exact _id
. The worst case scenario is we'll get a duplicate key error when we try to insert it.
However, an update is where the problem occurs. Especially, the update which is not item potent, that for instance included a $ink
command. So, we're telling the database to increment a certain field. Well in that case, if we get a network error and we don't know whether or not the update occurred. Now, maybe we know enough about the values that we can check with them that the update occurred, which is fine. But if we don't know the starting value in the database for that field, then it's not possible for us to know whether or not it occurred or not in case of network error. This kind of issues are extremely rare with a fine network.
And if we really need to avoid it at all costs, what we need to do is turn on all our updates into inserts, by reading the full value of the document out of the database and then potentially deleting it and inserting it again or just inserting a new one.
The reasons why an application may receive an error back even if the write was successful:
MongoDB
server terminates between receiving the write and responding to it.This Works for meTo stop the mongodb use:
And to Restart:
Adding the bin to PATH in Environment Variables helped.
GOTO Installation Path and copy the ../bin to the PATH variables in environment variables in Windows
type windows+rand enter the following
services.msc
start MongoDB
now type 'mongo' in cmd in the respective path where the mongo.exe is present, it will start working.
1.Create new folder in d drive D:/data/db
2.Open terminal on D:/data/db
3.Type mongod and enter.
4.Type mongo and enter.
and your mongodb has strated............
Just run mongod --repair
from C:Program FilesMongoDBServer4.0bin
Here is the doc https://docs.mongodb.com/manual/tutorial/recover-data-following-unexpected-shutdown/
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?