Mongodb master-slave configuration: replica set, mongodbreplica

Source: Internet
Author: User
Tags mongodb support

Mongodb master-slave configuration: replica set, mongodbreplica
1. Replica set
The master-slave deployment of 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-slave
Three machines, one master and two slave.
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 Synchronization
All data written to mongodb will be written to the primary master. 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.
Address: http://blog.csdn.net/yonggang7/article/details/38778373

Does MongoDB support both master-slave configuration and shard configuration? Answers from experts

It should be okay. mongodb currently does not officially recommend using master-slave replication. We recommend using replica set. replica set is used to improve system reliability, and sharding is used for horizontal scaling, if the two cannot be used at the same time, it is too bad.
However, the horizontal scaling level of apsaradb for mongodb is short. The insertion speed will be greatly reduced after replica set is used.
Sorry, I have not tried the replica set and sharding at the same time. After testing the replica set, the company decided not to use mongodb. I can only tell you so much, hope it can help

Can a node be In the replica set and master-slave statuses at the same time?

Are you configuring Mongodb?

MongoDB supports two replication modes:
Master/Slave, master-slave replication, including Master and Slave roles.
Replica Set, Replica Set replication, including primary and secondary roles.

You can only use one of them.

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.