Mongodb Master/Slave configuration: replica set replicaset

Source: Internet
Author: User
1. Master-slave deployment of replica set mongodb. The common mode is replica set (replicaset. Replicaset is a group of multiple mongod instances, including one primary and multiple slave databases. The advantage of this primary multi-slave mode is that mongodb self-O & M will automatically detect the heartbeat and select a new

1. Master-slave deployment of replica set mongodb, usually in the replica set mode. Replica set is a group of multiple mongod instances, including one primary and multiple slave databases. The advantage of this primary multi-slave mode is that mongodb self-O & M will automatically detect the heartbeat and select a new

1. Master-slave deployment of replica set mongodb, usually in the replica set mode. Replica set is a group of multiple mongod instances, including one primary and multiple slave databases. The advantage of this primary multi-slave mode is that mongodb self-O & M will automatically detect the heartbeat and elect a new primary if the primary server fails. Manual processing is not required. 2. Master-take three machines as an example, one master and two slaves.
There is a heartbeat between the master and slave to detect whether the master and slave are active. Heartbeat is sent to each other every 2 seconds. If no status is returned within 10 seconds, the service is marked as discarded and inaccessible. If the master fails. Then a new master is elected.
Then there is a new master-slave mode. 3. Data is written to the primary database of apsaradb for mongodb. The oplog of the operation generated by primary. Receives the primary oplog from secondary. Then the asynchronous process is called to write data from the slave. The optime is updated for each master-slave synchronization. The optime is used to determine the election of a new primary node. The latest optime will be selected as the new primary node. A replica set can have one or more slave columns.
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.