1
我在連接到配置服務器副本集時遇到問題,而且Mongo正在拋出很多錯誤。 使用的Mongodb版本是3.4.3,我在Amazon Linux和Ubuntu 14.04上面臨同樣的問題。 即使使用獨立的MongoDB配置服務器,也會發生該問題。Mongos無法啓動並拋出錯誤,ping分配鎖定失敗。 MongoDB 3.4.3問題
錯誤是:
2017-04-17T01:00:19.368+0530 W SHARDING [replSetDistLockPinger] pinging failed for distributed lock pinger :: caused by :: WriteConcernFailed: waiting for replication timed out. Error details: { wtimeout: true }
WriteConcernFailed: waiting for replication timed out. Error details: { wtimeout: true }
2017-04-17T00:53:48.230+0530 I NETWORK [mongosMain] Marking host 127.0.0.1:27021 as failed :: caused by :: ExceededTimeLimit: Operation timed out, request was RemoteCommand 45 -- target:127.0.0.1:27021 db:config expDate:2017-04-17T00:53:48.229+0530 cmd:{ find: "version", readConcern: { level: "majority", afterOpTime: { ts: Timestamp 0|0, t: -1 } }, maxTimeMS: 30000 }
2017-04-17T00:53:48.230+0530 I SHARDING [mongosMain] Operation timed out :: caused by :: ExceededTimeLimit: Operation timed out, request was RemoteCommand 45 -- target:127.0.0.1:27021 db:config expDate:2017-04-17T00:53:48.229+0530 cmd:{ find: "version", readConcern: { level: "majority", afterOpTime: { ts: Timestamp 0|0, t: -1 } }, maxTimeMS: 30000 }
2017-04-17T00:53:48.230+0530 W SHARDING [mongosMain] Error initializing sharding state, sleeping for 2 seconds and trying again :: caused by :: ExceededTimeLimit: Error loading clusterID :: caused by :: Operation timed out, request was RemoteCommand 45 -- target:127.0.0.1:27021 db:config expDate:2017-04-17T00:53:48.229+0530 cmd:{ find: "version", readConcern: { level: "majority", afterOpTime: { ts: Timestamp 0|0, t: -1 } }, maxTimeMS: 30000 }
任何幫助是非常讚賞。
下面是我使用的是配置的詳細信息:
rsconfig:SECONDARY> rs.status()
{
"set" : "rsconfig",
"date" : ISODate("2017-04-16T19:25:52.382Z"),
"myState" : 2,
"term" : NumberLong(1),
"syncingTo" : "127.0.0.1:27022",
"configsvr" : true,
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"appliedOpTime" : {
"ts" : Timestamp(1492370750, 1),
"t" : NumberLong(1)
},
"durableOpTime" : {
"ts" : Timestamp(1492369489, 1),
"t" : NumberLong(-1)
}
},
"members" : [
{
"_id" : 0,
"name" : "127.0.0.1:27020",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 1599,
"optime" : {
"ts" : Timestamp(1492370750, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2017-04-16T19:25:50Z"),
"syncingTo" : "127.0.0.1:27022",
"configVersion" : 1,
"self" : true
},
{
"_id" : 1,
"name" : "127.0.0.1:27021",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 1260,
"optime" : {
"ts" : Timestamp(1492370750, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1492369489, 1),
"t" : NumberLong(-1)
},
"optimeDate" : ISODate("2017-04-16T19:25:50Z"),
"optimeDurableDate" : ISODate("2017-04-16T19:04:49Z"),
"lastHeartbeat" : ISODate("2017-04-16T19:25:51.325Z"),
"lastHeartbeatRecv" : ISODate("2017-04-16T19:25:51.333Z"),
"pingMs" : NumberLong(0),
"syncingTo" : "127.0.0.1:27022",
"configVersion" : 1
},
{
"_id" : 2,
"name" : "127.0.0.1:27022",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 1260,
"optime" : {
"ts" : Timestamp(1492370750, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1492369489, 1),
"t" : NumberLong(-1)
},
"optimeDate" : ISODate("2017-04-16T19:25:50Z"),
"optimeDurableDate" : ISODate("2017-04-16T19:04:49Z"),
"lastHeartbeat" : ISODate("2017-04-16T19:25:51.325Z"),
"lastHeartbeatRecv" : ISODate("2017-04-16T19:25:50.792Z"),
"pingMs" : NumberLong(0),
"electionTime" : Timestamp(1492369500, 1),
"electionDate" : ISODate("2017-04-16T19:05:00Z"),
"configVersion" : 1
}
],
"ok" : 1
}
下面是爲配置一臺服務器的配置。 #mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: mongodb1
journal:
enabled: false
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: mongod1.log
# network interfaces
net:
port: 27020
bindIp: 127.0.0.1
#processManagement:
#security:
#operationProfiling:
replication:
replSetName: rsconfig
sharding:
clusterRole: configsvr
## Enterprise-Only Options:
#auditLog:
#snmp:
感謝您分享結果! – SpiXel