1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
| my_repl:PRIMARY> rs.status()
{
"set" : "my_repl",
"date" : ISODate("2021-02-23T07:56:10.466Z"),
"myState" : 1,
"term" : NumberLong(1),
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"readConcernMajorityOpTime" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"appliedOpTime" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"durableOpTime" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
}
},
"members" : [ ## 这里记录集群中所有实例的信息及其状态
{
"_id" : 0,
"name" : "10.7.171.239:28017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 421,
"optime" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-02-23T07:56:05Z"),
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "could not find member to sync from",
"electionTime" : Timestamp(1614066874, 1),
"electionDate" : ISODate("2021-02-23T07:54:34Z"),
"configVersion" : 1,
"self" : true,
"lastHeartbeatMessage" : ""
},
{
"_id" : 1,
"name" : "10.7.171.239:28018",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 106,
"optime" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-02-23T07:56:05Z"),
"optimeDurableDate" : ISODate("2021-02-23T07:56:05Z"),
"lastHeartbeat" : ISODate("2021-02-23T07:56:10.130Z"),
"lastHeartbeatRecv" : ISODate("2021-02-23T07:56:08.582Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "",
"syncingTo" : "10.7.171.239:28017",
"syncSourceHost" : "10.7.171.239:28017",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 1
},
{
"_id" : 2,
"name" : "10.7.171.239:28019",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 106,
"optime" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1614066965, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-02-23T07:56:05Z"),
"optimeDurableDate" : ISODate("2021-02-23T07:56:05Z"),
"lastHeartbeat" : ISODate("2021-02-23T07:56:10.130Z"),
"lastHeartbeatRecv" : ISODate("2021-02-23T07:56:08.581Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "",
"syncingTo" : "10.7.171.239:28017",
"syncSourceHost" : "10.7.171.239:28017",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 1
}
],
"ok" : 1,
"operationTime" : Timestamp(1614066965, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1614066965, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
|