MongoDB Cluster Form Inquiry-one master one from one arbitration.

Source: Internet
Author: User
Tags node server

Master node (primary) with slave node (secondary) and quorum node (arbiter)
A three-member replica set with two members that store data has:
a master node.
One from the node. The slave node can become the primary node in the election.
A quorum node quorum node only votes in the election.

Because the quorum node does not save a copy of the data, this deployment provides only a complete copy of the data (secondary). The quorum node requires less resources and sacrifices more limited redundancy and fault tolerance.

However, with the master node, the deployment of the slave node and the quorum and the single is ensured that the replica set remains available if the primary server or slave server is unavailable.

If the primary server is unavailable, the replica set selects the slave node server as the primary server.

I was deployed through the trove component of OpenStack a cluster form of a master two from a replica set.

Test by stopping one of the nodes from the node, moving out of the cluster, and then turning him into a quorum node, as follows:

Https://docs.mongodb.com/v3.2/tutorial/convert-secondary-into-arbiter/index.html

The main point is that, since the trove created by cluster is enabled for authentication, it is necessary to keyfile at boot time to complete communication between the quorum node and the master-slave node.

Command:

Mongod--port 27017--dbpath/data--replset rs1--config/etc/mongod.conf

Rs1:secondary>Db.ismaster () {"hosts" : [        "192.168.111.173:27017",        "192.168.111.174:27017"    ],    "Arbiters" : [        "192.168.111.172:27017"    ],    "SetName":"rs1",    "setversion":8,    "IsMaster":false,    "Secondary":true,    "Primary":"192.168.111.173:27017",    "Me":"192.168.111.174:27017",    "maxbsonobjectsize":16777216,    "maxmessagesizebytes":48000000,    "maxwritebatchsize": +,    "localtime": Isodate ("2017-10-24t09:16:11.858z"),    "maxwireversion":4,    "minwireversion":0,    "OK":1}kill off the MongoDB process on the master node rs1:secondary>Db.ismaster () {"hosts" : [        "192.168.111.173:27017",        "192.168.111.174:27017"    ],    "Arbiters" : [        "192.168.111.172:27017"    ],    "SetName":"rs1",    "setversion":8,    "IsMaster":true,    "Secondary":false,    "Primary":"192.168.111.174:27017",    "Me":"192.168.111.174:27017",    "Electionid": ObjectId ("7fffffff0000000000000006"),    "maxbsonobjectsize":16777216,    "maxmessagesizebytes":48000000,    "maxwritebatchsize": +,    "localtime": Isodate ("2017-10-24t09:16:49.220z"),    "maxwireversion":4,    "minwireversion":0,    "OK":1,    "$gleStats" : {        "Lastoptime": Timestamp (0,0),        "Electionid": ObjectId ("7fffffff0000000000000006")    }}

Summarize:

1. If the primary node is down, the slave node will not be promoted to the primary node when we deploy it only in a master-one way.

(1): When restarting the master node, there are two possibilities. 1. The master node becomes the slave node, and the node is elected as the new master node. 2. The master-slave node does not change (presumably this is due to)

2. When a primary one is added to a quorum node,

(1): Master node down, from the node to promote the primary node.

(2): After the node restarts, it becomes the slave node of the current master node.

MongoDB Cluster Form Inquiry-one master one from one arbitration.

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.