Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongodb can't start on windows?

Tags:

mongodb

when i tried to start mongodb using the command "mongod.exe" on the command line, it throws the following error..

C:\mongodb-win32-x86_64-2.0.6\bin>mongod.exe
mongod.exe --help for help and startup options
Thu Aug 09 11:56:48 [initandlisten] MongoDB starting : pid=6892 port=27017 dbpat
h=/data/db 64-bit host=user4-PC
Thu Aug 09 11:56:48 [initandlisten] db version v2.0.6, pdfile version 4.5
Thu Aug 09 11:56:48 [initandlisten] git version: e1c0cbc25863f6356aa4e31375add7b
b49fb05bc
Thu Aug 09 11:56:48 [initandlisten] build info: windows sys.getwindowsversion(ma
jor=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB
_VERSION=1_42
Thu Aug 09 11:56:48 [initandlisten] options: {}
**************
old lock file: \data\db\mongod.lock.  probably means unclean shutdown,
but there are no journal files to recover.
this is likely human error or filesystem corruption.
found 3 dbs.
see: http://dochub.mongodb.org/core/repair for more information
*************
Thu Aug 09 11:56:48 [initandlisten] exception in initAndListen: 12596 old lock f
ile, terminating
Thu Aug 09 11:56:48 dbexit:
Thu Aug 09 11:56:48 [initandlisten] shutdown: going to close listening sockets..
.
Thu Aug 09 11:56:48 [initandlisten] shutdown: going to flush diaglog...
Thu Aug 09 11:56:48 [initandlisten] shutdown: going to close sockets...
Thu Aug 09 11:56:48 [initandlisten] shutdown: waiting for fs preallocator...
Thu Aug 09 11:56:48 [initandlisten] shutdown: lock for final commit...
Thu Aug 09 11:56:48 [initandlisten] shutdown: final commit...
Thu Aug 09 11:56:48 [initandlisten] shutdown: closing all files...
Thu Aug 09 11:56:48 [initandlisten] closeAllFiles() finished
Thu Aug 09 11:56:48 dbexit: really exiting now

i really cant start mongodb.. Help me to start mongodb as windows service and rectify the error. I already read the installation guide and followed the same but still throwing the error.

like image 499
user1578749 Avatar asked Aug 09 '12 06:08

user1578749


People also ask

Why MongoDB server is not starting?

We found that the reason for this error was the dbpath variable in /etc/mongodb. conf. Previously, the default value for dbpath was /data/db. The upstart job mongodb(which comes with mongodb-10gen package) invokes the mongod with –config /etc/mongodb.

Can you run MongoDB on Windows?

Installing and Running MongoDB on a Windows MachineDownload the MongoDB installer file from the downloads section of the MongoDB website. Find the dowloaded . msi file in the Windows Explorer. Double click the file and follow the prompts to install Mongo.

Why is my MongoDB not connecting?

Ensure Your MongoDB Instance is Running Compass must connect to a running MongoDB instance. Make sure you have installed MongoDB and have a running mongod process. You should also check that the port where your MongoDB instance is running matches the port you provide in the Compass connect dialog.


Video Answer


1 Answers

Delete the lock file \data\db\mongod.lock, and run mongod --repair.

source

like image 182
Eivind Eidheim Elseth Avatar answered Oct 06 '22 00:10

Eivind Eidheim Elseth