-- 在建立shardcollection的時候報錯
mongos> db.runCommand({shardcollection:'test.test',key:{_id:1}})
{
"assertion" : "invalid parameter: expected an object ()",
"assertionCode" : 10065,
"errmsg" : "db assertion failure",
"ok" : 0
-- 原因:啟動mongod的時候添加了replSet的選項導致找不到master
-- 解決:重新啟動mongod,將replSet選項取消
-------------------------------------------------------------------------------------------------------------------------------------
-- 由於伺服器時間不同步導致auto sharding失敗
Fri Jan 6 12:46:09 [Balancer] caught exception while doing balance: error checking clock skew of cluster 10.192.9.110:20000,10.192.
136.242:20000,10.192.9.90:20000 :: caused by :: 13650 clock skew of the cluster 10.192.9.110:20000,10.192.136.242:20000,10.192.9.90:
20000 is too far out of bounds to allow distributed locking.
Fri Jan 6 13:14:24 [conn2] warning: - cmd: { splitChunk: "test1.test1", keyPattern: { _id: 1.0 }, min: { _id: Min
Key }, max: { _id: MaxKey }, from: "10.192.9.110:10000", splitKeys: [ { _id: 0.0 } ], shardId: "test1.test1-_id_MinKey", configdb: "
10.192.9.110:20000,10.192.136.242:20000,10.192.9.90:20000" } result: { errmsg: "Error locking distributed lock for split. :: caused
by :: 13651 error checking clock skew of cluster 10.192.9.110:20000,10.192.136.242:20000,10.192.9....", ok: 0.0 }
cp /usr/share/zoneinfo/GMT /etc/localtime
ntpdate 10.192.0.12 -- 時間伺服器
---------------------------------------------------------------------------------------------------------------------
-- config服務一直無緣無故停止
Mon Jan 9 07:04:56 [Balancer] moveChunk result: { cause: { assertion: "Can't take a write lock while out of disk space", assertionCode: 14031, errmsg: "db assertion failure", ok: 0.0 }, errmsg: "moveChunk failed to engage TO-shard in the data transfer: db assertion failure", ok: 0.0 }
Mon Jan 9 07:04:56 [Balancer] balancer move failed: { cause: { assertion: "Can't take a write lock while out of disk space", assertionCode: 14031, errmsg: "db assertion failure", ok: 0.0 }, errmsg: "moveChunk failed to engage TO-shard in the data transfer: db assertion failure", ok: 0.0 } from: s2 to: s1 chunk: { _id: "test.test-_id_16690.0", lastmod: Timestamp 3000|1, ns: "test.test", min: { _id: 16690.0 }, max: { _id: 50791.0 }, shard: "s2" }
問題原因:10.192.9.90磁碟空間滿
解決方案:增加磁碟空間