Database Reference
In-Depth Information
{
"_id" : 1,
"name" : "[hostname]:27022",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 66,
"optime" : {
"t" : 1370259331,
"i" : 1
},
"optimeDate" : ISODate("2013-06-03T11:35:31Z"),
"lastHeartbeat" : ISODate("2013-06-03T11:36:35Z"),
"lastHeartbeatRecv" : ISODate("2013-06-03T11:36:36Z"),
"pingMs" : 0,
"syncingTo" : "[hostname]:27021"
}
],
"ok" : 1
}
Now let's make use of that third passive member. First add the member as usual with rs.add() :
$ mongo [hostname]:27022
> rs.add("[hostname]:27022")
{ "ok" : 1 }
Now we need to make a copy of the config document and modify it. Run the following command to create a
document called conf , which contains your current replica set configuration.
> conf = rs.conf()
{
"_id" : "testset",
"version" : 3,
"members" : [
{
"_id" : 0,
"host" : "[hostname]:27021"
},
{
"_id" : 1,
"host" : "[hostname]:27022"
},
{
"_id" : 2,
"host" : "[hostname]:27023"
}
]
}
Search WWH ::




Custom Search