Mongodb

MongoDB 新副本集節點未上線

  • September 3, 2015

在主節點上添加新的 MongoDB 副本集節點後,我得到

> rs.status()
{
...
       {
           "_id" : 2,
           "name" : "nde3.test.com:27017",
           "health" : 1,
           "state" : 6,
           "stateStr" : "UNKNOWN",
           "uptime" : 129,
           "optime" : {
               "t" : 0,
               "i" : 0
           },
           "optimeDate" : ISODate("1970-01-01T00:00:00Z"),
           "lastHeartbeat" : ISODate("2013-06-06T13:01:30Z"),
           "lastHeartbeatRecv" : ISODate("1970-01-01T00:00:00Z"),
           "pingMs" : 64,
           "lastHeartbeatMessage" : "still initializing"
       }
   ],
...
}

在我得到的新節點上

> rs.status()
{
   "startupStatus" : 4,
   "ok" : 0,
   "errmsg" : "can't currently get local.system.replset config from self or any seed (EMPTYUNREACHABLE)"
}

新副本集節點上的“/etc/hosts/”中有錯字

例子

nde3.test.com       1.1.1.1

本來應該

nde3.test.com       1.1.1.2

引用自:https://serverfault.com/questions/513761