|
RS:PRIMARY> rs.status(); #查看副本集状态
{
"set" : "RS",
"date" : ISODate("2017-11-26T14:09:00.054Z"),
"myState" : 1,
"term" : NumberLong(1),
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
},
"appliedOpTime" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
},
"durableOpTime" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
}
},
"members" : [
{
"_id" : 0,
"name" : "172.20.6.10:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY", #主节点
"uptime" : 377,
"optime" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2017-11-26T14:08:53Z"),
"infoMessage" : "could not find member to sync from",
"electionTime" : Timestamp(1511705241, 1),
"electionDate" : ISODate("2017-11-26T14:07:21Z"),
"configVersion" : 1,
"self" : true
},
{
"_id" : 1,
"name" : "172.20.6.11:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY", #secondary节点
"uptime" : 109,
"optime" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2017-11-26T14:08:53Z"),
"optimeDurableDate" : ISODate("2017-11-26T14:08:53Z"),
"lastHeartbeat" : ISODate("2017-11-26T14:09:00.053Z"),
"lastHeartbeatRecv" : ISODate("2017-11-26T14:08:59.072Z"),
"pingMs" : NumberLong(0),
"syncingTo" : "172.20.6.10:27017",
"configVersion" : 1
},
{
"_id" : 2,
"name" : "172.20.6.12:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY", #secondary节点
"uptime" : 109,
"optime" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1511705333, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2017-11-26T14:08:53Z"),
"optimeDurableDate" : ISODate("2017-11-26T14:08:53Z"),
"lastHeartbeat" : ISODate("2017-11-26T14:09:00.053Z"),
"lastHeartbeatRecv" : ISODate("2017-11-26T14:08:59.054Z"),
"pingMs" : NumberLong(0),
"syncingTo" : "172.20.6.10:27017",
"configVersion" : 1
}
],
"ok" : 1
}
|
|