MongoDB Master-slave configuration: Replica set replica set

Source: Internet
Author: User
1. Replica set
The master-slave deployment of MongoDB is commonly used in the form of a replica set (replica set). Replica set is a set of multiple Mongod instances that comprise a group of groups, including a master primary, and multiple from secondary. The advantage of this one master multi-slave approach is that MongoDB self-ops, if the main server hangs, will be automatically detected by heartbeat, elect a new master to come. No manual processing is required.
2. Master-Slave
Three machines do an example, a master two from.
There is a heartbeat between the primary and the slave to detect whether it is active. Each 2s heartbeat each other, if there is no return status within 10 seconds, the service is marked as discarded, inaccessible state. If the master hangs up. Then elect the new Lord out.
Then again is the new master-slave pattern.
3. Data synchronization
MongoDB's data write will fall to primary. Primary the Oplog of the build operation. Receives the Oplog of the Lord's primary from secondary. The asynchronous process is then called to write from the data. Each master-slave synchronization is updated with Optime. The election of the new master is determined by Optime, and the newest optime will be chosen as the new Lord. A replica set can have one or more from secondary.
Address: http://blog.csdn.net/yonggang7/article/details/38778373

MongoDB Master-slave configuration: Replica set replica set

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.