Fast manual installation of MongoDB

Source: Internet
Author: User

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.

    1. 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)
    2. 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:
    3. After saving the following code to the bat file, double-click to run
    • Main Library:
@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
    • From library:
@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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.