"MongoDB" Windows platform build MONGO database replica set (similar cluster) (i)

Source: Internet
Author: User

Replica sets (replica set) is a new feature that starts with the mongodDB1.6 version number. It can realize fault self-switchover and self-active repair function member node function, the data between each db is identical, greatly reduces the risk of single point of failure.

【】


This is the replica set schema for three nodes. The figure is from the book "The Essentials of MongoDB Management and development" written by Red pill. From being able to see, the structure resembles a cluster. In fact, it can be a cluster altogether. Because it does have the same effect as the cluster implementation.

First, deploy replica sets.

Next shows how to demonstrate the deployment of the 3-node replica on a single server sets



Second, start replica service

Open three command forms separately, and then run the following three sentences, respectively.

Mongod.exe  --replset rs1--keyfile "D:\Program files\mongodb\data\replica\key\r0"--port 28010--dbpath "D:\ Program Files\mongodb\data\replica\data\r0 "--logpath" D:\Program files\mongodb\data\replica\log\r0.log "-- Logappendmongod.exe  --replset rs1--keyfile "D:\Program files\mongodb\data\replica\key\r1"--port 28011--dbpath " D:\Program files\mongodb\data\replica\data\r1 "--logpath" D:\Program files\mongodb\data\replica\log\r1.log "-- logappendcd/d D:\Program files\mongodb\binmongod.exe  --replset rs1--keyfile "D:\Program files\mongodb\data\ Replica\key\r2 "--port 28012--dbpath" D:\Program files\mongodb\data\replica\data\r2 "--logpath" D:\Program Files\ Mongodb\data\replica\log\r2.log "--logappend




Third, login client, initialize replica sets environment



watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvc3himdg0mtkwmtexng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">


"MongoDB" Windows platform build MONGO database replica set (similar cluster) (i)

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.