Error starting MongoDB in windows 7 [32-bit]

11.7k views Asked by At

I followed a blog(link) to install and configure MongoDB in my system[Windows 7 32 bit].

As per blogger said, I have download mongodb-win32-i386-2.6.5 and extract to D:/mongodb/ and followed the blog

Upto installation everything alright, but when I try to start service using following command,

 D:\mongodb\bin>net start MongoDB

I got error response as,

System error 2 has occurred.

The system cannot find the file specified.

How to solve this ?


Update : Log File

2014-11-19T16:43:25.356+0530 [DataFileSync] flushing diag log

2014-11-19T16:43:25.403+0530 [initandlisten] MongoDB starting : pid=5128 port=27017 dbpath=D:\mongodb\data 32-bit host=AVVENIRE-JAVA

2014-11-19T16:43:25.403+0530 [initandlisten]

2014-11-19T16:43:25.403+0530 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.

2014-11-19T16:43:25.403+0530 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).

2014-11-19T16:43:25.403+0530 [initandlisten] ** See http://dochub.mongodb.org/core/32bit

2014-11-19T16:43:25.404+0530 [initandlisten]

2014-11-19T16:43:25.404+0530 [initandlisten] targetMinOS: Windows XP SP3

2014-11-19T16:43:25.404+0530 [initandlisten] db version v2.6.1

2014-11-19T16:43:25.404+0530 [initandlisten] git version: 4b95b086d2374bdcfcdf2249272fb552c9c726e8

2014-11-19T16:43:25.404+0530 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=0, build=6002, platform=2, service_pack='Service Pack 2') BOOST_LIB_VERSION=1_49

2014-11-19T16:43:25.404+0530 [initandlisten] allocator: system 2014-11-19T16:43:25.404+0530 [initandlisten] options: { config: "d:\mongodb\mongo.config", diaglog: 3, net: { bindIp: "127.0.0.1", port: 27017 }, storage: { dbPath: "D:\mongodb\data", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "D:\mongodb\log\mongo.log", quiet: true } }

2014-11-19T16:43:25.483+0530 [initandlisten] journal dir=D:\mongodb\data\journal

2014-11-19T16:43:25.484+0530 [initandlisten] recover : no journal files present, no recovery needed

2014-11-19T16:43:25.770+0530 [initandlisten] waiting for connections on port 27017

2014-11-19T16:44:25.439+0530 [DataFileSync] flushing diag log

2014-11-19T16:45:25.361+0530 [DataFileSync] flushing diag log

2014-11-19T16:46:25.360+0530 [DataFileSync] flushing diag log

2014-11-19T16:46:31.869+0530 [conn1] terminating, shutdown command received

2014-11-19T16:46:31.869+0530 [conn1] dbexit: shutdown called

2014-11-19T16:46:31.869+0530 [conn1] shutdown: going to close listening sockets...

2014-11-19T16:46:31.869+0530 [conn1] closing listening socket: 540

2014-11-19T16:46:31.869+0530 [conn1] shutdown: going to flush diaglog...

2014-11-19T16:46:31.869+0530 [conn1] flushing diag log

2014-11-19T16:46:31.869+0530 [conn1] shutdown: going to close sockets...

2014-11-19T16:46:31.870+0530 [conn1] shutdown: waiting for fs preallocator...

2014-11-19T16:46:31.870+0530 [conn1] shutdown: lock for final commit...

2014-11-19T16:46:31.870+0530 [conn1] shutdown: final commit...

2014-11-19T16:46:31.873+0530 [conn1] shutdown: closing all files...

2014-11-19T16:46:31.873+0530 [conn1] closeAllFiles() finished

2014-11-19T16:46:31.873+0530 [conn1] journalCleanup...

2014-11-19T16:46:31.889+0530 [conn1] removeJournalFiles

2014-11-19T16:46:31.891+0530 [conn1] shutdown: removing fs lock...

2014-11-19T16:46:31.891+0530 [conn1] dbexit: really exiting now

2014-11-19T16:47:08.985+0530 ***** SERVER RESTARTED *****

2014-11-19T16:47:08.985+0530 Trying to install Windows service 'MongoDB'

2014-11-19T16:47:08.985+0530 There is already a service named 'MongoDB', aborting


Update 2(result of @disposer's suggestion):

enter image description here

5

There are 5 answers

7
Disposer On BEST ANSWER

Run Command window as administrator and run net delete MongoDB

For running mongo as a service use this:

C:\mongodb\bin\mongod --bind_ip  0.0.0.0 --logpath  "C:\Data\db\log.txt"  --logappend  --dbpath  "C:\Data\db"  --port 27017 --serviceName "MongoDB" --serviceDisplayName "MongoDB" --install

then run Command window as administrator and run net start MongoDB

0
piyush tiwari On

in log file if it shows this"There is already a service named 'MongoDB', sleeping and retrying" that mean you are reinstalling mongodb.for resolve this problem just run

  1. mongod --remove in command prompt in bin folder.it will remove service MongoDB.
  2. then run mongod --directoryperdb --dbpath C:\mongodb\data\db --logpath C:\mongodb\log\mongo.log --logappend --install.
  3. and the last command net start MongoDB will run MongoDB service.
0
alfa On

I got the same error with MongoDB 3.2 for 32 bit.

  1. Try to make new db folder

  2. Copy-paste your database from old db folder ( there are 2 files )

  3. Connect it with new db folder using cmd

You won't loss your database. It had happened with me twice. I don't why it happened

0
HydTechie On

Download from this link @ http://downloads.mongodb.org/win32/mongodb-win32-i386-v3.2-latest-signed.msi?_ga=1.10304565.1436936475.1490595203

After installation in E: drive, run mongod command with options @ E:\Program Files\MongoDB\Server\3.2\bin> mongod --storageEngine=mmapv1 --dbpath C:\data\db

Observe, two options are necessary to be installed without errors, specially for 32-bit, --storageEngine=mmapv1 and create a directory in OS drive(c:) only as --dbpath C:\data\db

Keep your server running at command prompt, install mongobooster from http://s3.mongobooster.com/download/3.5/mongobooster-3.5.3.exe for GUI to manage mongodb. and connect to local database..try samples @ https://www.youtube.com/playlist?list=PL6gx4Cwl9DGDQ5DrbIl20Zu9hx1IjeVhO

0
d_bhatnagar On

I got it working like this..

  1. Install the latest msi version.

  2. Create the folders c:\data\db

  3. In my bin directory (C:\Program Files\MongoDB\Server\3.2\bin), I ran mongod --storageEngine=mmapv1 --dbpath C:\data\db using CMD.

  4. Opened up a new CMD window (Keeping the one from 1st step still running) and traveled to the same bin directory (C:\Program Files\MongoDB\Server\3.2\bin) and then ran mongo.exe

Hope it helps