MongoDB replica set Configuration and description

Source: Internet
Author: User

1, the principle of the replica set

The principle of the replica set is similar to the master-slave, the only difference is that when the primary node fails, the master-slave server will not automatically become the primary server, but to manually modify the configuration. But the sub-table set is not used, it will automatically select a server to do the primary node, so as to ensure the stability of the system.

2, how is the new master node of the replica set elected?

is through the bully algorithm, that is, the consistency protocol. Specific as follows

1): When the primary node is hung, the replica set gets the other last update time from the node compared to the main service

2): If all the last update time from the node is very old, then the election will stop

3): If most of the servers in the replica set are hung, and the primary node is included, then the election stops

4): If none of the above occurs, then update time is the most recent election to the main node

5): If the update time is the same, then who is the fastest to become the main node who is the primary node

Note: The node of the parameter election must be more than half the nodes in the replica set

3. Roles for each node in the 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.