Database Reference
In-Depth Information
"pingMs" : 0,
"syncingTo" : "[hostname]:27021"
}
],
"ok" : 1
}
Each field shown in the example has a meaning, as described in Table 11-3 . These values can be used to
understand the status of current members of the replica set.
Table 11-3. Values for the rs.status Fields
Value
Description
_id
The ID of this member as part of the replica set
Name
The member's hostname
Health
The health value of the r eplSet
State
The numeric value of the state
StateStr
The string representation of this replica set member's state
Uptime
How long this member has been up
optime
The time of the last operation applied on this member, in the format of a timestamp and an
integer value
optimeDate
The date of the last applied operation
lastHeartbeat
The date of the last heartbeat sent
lastHeartbeatRecv
The date of the last heartbeat received
pingMs
The ping time between the member on whom rs.status() was run and each remote
member
syncingTo
The member of the replica set to which this given node is syncing to match
In the preceding example, the rs.status() command was run against the primary server member. The
information returned for this command shows that the primary server is operating with a myState value of 1 ; in other
words, the “Member is operating as a primary (master).”
Forcing a New Election with rs.stepDown( )
You can use the rs.stepDown() command to force a primary server to stand down for 60 seconds; the command also
forces the election of a new primary server. This command is useful in the following situations:
When you need to take the server hosting the primary instance offline, whether to investigate
the server or to implement hardware upgrades or maintenance.
When you want to run a diagnostic process against the data structures.
When you want to simulate the effect of a primary failure and force your cluster to fail over, so
you can test how your application responds to such an event.
 
 
Search WWH ::




Custom Search