There are different ways you can install MongoDB as Windows Service..
Specifying argument directoryperdb creates separate directory structure for different DBs like admin, mydb etc.
Using mongod
mongod --config "M:\mongodb\conf\mongod.cfg" --serviceName "MongoDB" --serviceDisplayName "MongoDB" --serviceDescription "MongoDB Server Instance" --install
mongod --logpath M:\mongodb\data\log\mongo.log --dbpath M:\mongodb\data\db --auth --directoryperdb --install
Specifying argument directoryperdb creates separate directory structure for different DBs like admin, mydb etc.
Using Windows Service command
sc.exe create MongoDB binPath= "\"M:\mongodb\bin\mongod.exe\" --service --config=\"M:\mongodb\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"
Following the Windows service command, make sure Service console is not opened.
Start/Stop MongoDB Service
net start MongoDB
net stop MongoDB
Deleting MongoDB Service
mongod --remove
sc.exe delete MongoDB
Comments
Post a Comment