I have mongodb 2.6.11 cluster of two members: nms02 and nms01m. I know how to force secondary to become primary when primary is avail. But now my primary nms02 failed..and nms01m is secondary...How I force secondary to become primary now ?
nms:SECONDARY> rs.status()
{
"set" : "nms",
"date" : ISODate("2015-12-19T14:52:41Z"),
"myState" : 2,
"members" : [
{
"_id" : 0,
"name" : "nms02:27017",
"health" : 0,
"state" : 8,
"stateStr" : "(not reachable/healthy)",
"uptime" : 0,
"optime" : Timestamp(1450445883, 1),
"optimeDate" : ISODate("2015-12-18T13:38:03Z"),
"lastHeartbeat" : ISODate("2015-12-19T14:52:37Z"),
"lastHeartbeatRecv" : ISODate("2015-12-18T13:38:03Z"),
"pingMs" : 0,
"syncingTo" : "nms01m:27017"
},
{
"_id" : 1,
"name" : "nms01m:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 180204,
"optime" : Timestamp(1450445886, 1),
"optimeDate" : ISODate("2015-12-18T13:38:06Z"),
"self" : true
}
],
"ok" : 1
}
I can't do much on secondary now
nms:SECONDARY> cfg = rs.conf()
2015-12-19T10:20:51.821-0500 error: { "$err" : "not authorized for query on local.system.replset", "code" : 13 } at src/mongo/shell/query.js:131