Last active
May 9, 2017 07:28
-
-
Save mawiseman/27580c0dd410be9f0ff816ec4d41c65a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ECHO MongoDB Installation | |
@ECHO OFF | |
set mongoVersion=3.2 | |
set mongoServiceName="MongoDB-%mongoVersion%" | |
set mongoDBFolder=C:\Data\MongoDB\%mongoVersion% | |
set mongoDBDataFolder=%mongoDBFolder%\Data | |
set mongoDBLogsFolder=%mongoDBFolder%\Logs | |
set mongoDBMongoD="C:\Program Files\MongoDB\Server\%mongoVersion%\bin\mongod.exe" | |
set mongoDBMongo="C:\Program Files\MongoDB\Server\%mongoVersion%\bin\mongo.exe" | |
set mongoDBIP="127.0.0.1" | |
set mongoDBPort="27017" | |
@ECHO ON | |
ECHO MongoFolder: Creating | |
mkdir %mongoDBFolder% | |
mkdir %mongoDBDataFolder% | |
mkdir %mongoDBLogsFolder% | |
ECHO MongoFolder: Created / Finished | |
pause | |
ECHO Stop and Remove Old Service | |
%mongoDBMongoD% --remove --serviceName %mongoServiceName% | |
ECHO Stopped and Removed | |
pause | |
ECHO MongoSetup: Configuring installation | |
%mongoDBMongoD% --logpath %mongoDBLogsFolder%\Mongo.log --dbpath %mongoDBDataFolder% --directoryperdb --port %mongoDBPort% --logappend --quiet --noauth --install --serviceName %mongoServiceName% --serviceDisplayName %mongoServiceName% | |
ECHO MongoSetup: Finished installation | |
pause | |
ECHO MongoService: Starting Service | |
net start %mongoServiceName% | |
ECHO MongoService: Started | |
pause | |
ECHO Checking Status Output | |
%mongoDBMongo% %mongoDBIP%:%mongoDBPort%/admin | |
db.serverStatus() | |
exit | |
ECHO Finished Setting Up Replication Sets | |
pause | |
ECHO Running Browser to Confirm Installation | |
start http://%mongoDBIP%:%mongoDBPort%/ | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment