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