MongoDB Master-Slave configuration information View and confirmation

Source: Internet
Author: User

In the local library, there is not only a collection of master and slave log oplog, but also a collection for recording master-slave configuration information System.replset:

> Use Local

> Show Collections

> Db.system.replset.find ()

rs1:primary> Use Localuse Local

Switched to DB Local

Rs1:primary> Show Collectionsshow Collections

Me

Oplog.rs

Replset.election

Startup_log

System.replset

Rs1:primary> Db.system.replset.find () Db.system.replset.find ()

{"_id": "Rs1", "Version": 1, "ProtocolVersion": Numberlong (1), "members": [{"_id": 0, "host": "localhost:28010", "Arbiteronly": false, "buildindexes": True, "hidden": false, "priority": 1, "tags": {}, "Slavedelay": Numberlong (0 ), "votes": 1}, {"_id": 1, "host": "localhost:28011", "arbiteronly": false, "buildindexes": True, "hidden": false, "Priority": 1, "tags": {}, "Slavedelay": Numberlong (0), "votes": 1}, {"_id": 2, "host": "localhost:28012", "arb Iteronly ": false," buildindexes ": True," hidden ": false," priority ": 1," tags ": {}," Slavedelay ": Numberlong (0)," Votes ": 1}]," settings ": {" chainingallowed ": True," heartbeatintervalmillis ": +," heartbeattimeoutsecs ": Ten," E Lectiontimeoutmillis ": 10000," Getlasterrormodes ": {}," Getlasterrordefaults ": {" W ": 1," Wtimeout ": 0}," replicas Etid ": ObjectId (" 5791ea00a9dbf7228bb1ec0c ")}}

Rs1:primary>

As can be seen from this collection, Replica sets configuration information can also be performed from any existing member instance rs.conf () to view the information.

MongoDB Master-Slave configuration information View and confirmation

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.