6

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

Community
  • 1
  • 1
A J
  • 492
  • 1
  • 7
  • 24
  • Would you please share the logs. Moreover running on 32 bit version is not at all advisable. – vmr Nov 19 '14 at 10:52
  • @vmr I have updated logs in my question, please take a look and help me...(i have no idea about NoSql db) – A J Nov 19 '14 at 11:23
  • Hmm better try with a 64bit version of MongoDB. Then start it from bin folder with 'mongod.exe' – vmr Nov 19 '14 at 11:28
  • @vmr But its not compatible 64-bit MongoDB on 32-bit Windows, can you help me to do with Windows 32 - bit – A J Nov 19 '14 at 11:35
  • You can start a bounty. – vmr Nov 19 '14 at 12:00

5 Answers5

7

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

Disposer
  • 6,201
  • 4
  • 31
  • 38
  • When running mongo as a service as u said, getting response as, `The filename, directory name, or volume label syntax is incorrect` – A J Nov 20 '14 at 07:55
  • Oh, my bad change C:\mongodb\bin\mongod" to C:\mongodb\bin\mongod, useless " – Disposer Nov 20 '14 at 08:03
  • I have updated the result I got with your suggestion updated in my question, please take a look... – A J Nov 20 '14 at 08:06
  • I see no error, just warnings, check your services from control panel and check for MongoDb service, it should be there – Disposer Nov 20 '14 at 08:09
  • Add `--journal` to command and remove `--bind_ip 0.0.0.0` from it, see what happens, just run command as administrator – Disposer Nov 20 '14 at 08:17
  • service has been added with --bind_ip 0.0.0.0 itself... Thank you. – A J Nov 20 '14 at 08:21
  • Should it be 'sc delete...' and not 'net delete'? – circuitBurn Jul 28 '15 at 17:38
6

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

HydTechie
  • 797
  • 10
  • 17
4

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

JoshYates1980
  • 3,476
  • 2
  • 36
  • 57
d_bhatnagar
  • 1,419
  • 1
  • 12
  • 20
3

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

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

Samvel Aleqsanyan
  • 2,812
  • 4
  • 20
  • 28
alfa
  • 1