Database Reference
In-Depth Information
Inspecting an Instance's Status with rs.status( )
As you should be aware to from our earlier adventures in adding members to a replica set, rs.status() is probably
the command that you will use most often when working with replica sets. It allows you to inspect the status of the
instance you are currently attached to, including its role in the replica set:
>rs.status()
> rs.status();
{
"set" : "testset",
"date" : ISODate("2013-06-04T10:57:24Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "[hostname]:27021",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 4131,
"optime" : Timestamp(1370340105, 1),
"optimeDate" : ISODate("2013-06-04T10:01:45Z"),
"self" : true
},
{
"_id" : 1,
"name" : "[hostname]:27022",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 3339,
"optime" : Timestamp(1370340105, 1),
"optimeDate" : ISODate("2013-06-04T10:01:45Z"),
"lastHeartbeat" : ISODate("2013-06-04T10:57:23Z"),
"lastHeartbeatRecv" : ISODate("2013-06-04T10:57:23Z"),
"pingMs" : 0,
"syncingTo" : "[hostname]:27021"
},
{
"_id" : 2,
"name" : "[hostname]:27023",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 3339,
"optime" : Timestamp(1370340105, 1),
"optimeDate" : ISODate("2013-06-04T10:01:45Z"),
"lastHeartbeat" : ISODate("2013-06-04T10:57:22Z"),
"lastHeartbeatRecv" : ISODate("2013-06-04T10:57:23Z"),
 
Search WWH ::




Custom Search