The previous article, "Mongodb.webide: The upgraded version of MongoDB management tools," missing something: It is about the MongoDB master and slave library installation configuration and startup. There are a lot of articles about MongoDB installed on the Internet for everyone to learn. I am here to provide a quick manual installation of the MongoDB master-slave library in a Windows environment, which requires only three steps.
- Download the installation package first, find the Bin folder after extracting it, and copy the bin folder to your own installation directory (you can copy the bin directory from the installed directory of this machine and other machines)
- Create a new data directory in the same sibling directory as the bin directory, and create a new DB and log directory in the data directory, such as the following directory structure:
- After saving the following code to the bat file, double-click to run
@echo CD Files\mongodb\"C:\Program files\mongodb\data\db" "Mongodbmaster"-servicedisplayname " Mongodbmaster "--dbpath" C:\Program files\mongodb\data\db "--logpath" C:\Program files\mongodb\data\log\mongodb.log " netstart mongodbmaster@Pause
@echo CD Files\mongodb\"D:\Program files\mongodb\data\db" "Mongodbslave"-servicedisplayname " Mongodbslave "--dbpath" D:\Program files\mongodb\data\db "--logpath" D:\Program files\mongodb\data\log\mongodb.log "- -port=28018--slave--source=127.0.0.1:27017netstart mongodbslave@Pause
Description:
-
-
- 1th, 2 steps to do two times, that is, the installation directory corresponding: The main library-c:\program Files\mongodb;-d:\program files\mongodb
- Run the batch command for the main library before running from the library, both of which will automatically start with the Windows service
-
-
@echo "Stopping service ..."net Stop "Mongodbslave"@echo "Removing service ...""Mongodbslave"@echo "Press any key to exit "@pause
- If you only need to make an instance of this machine, you can use the following code (in this case, a different installation directory):
@echo CD Files\mongodb2\"D:\Program files\mongodb2\data\db" "MongoDB2"-servicedisplayname " MongoDB2 "--dbpath" D:\Program files\mongodb2\data\db "--logpath" D:\Program files\mongodb2\data\log\mongodb.log "-- port=29019netstart "MongoDB2"@pause
Fast manual installation of MongoDB