在停止balancer之后,备份整个分片库,然后启用balancer,删除分片集合并重建。遇到以下报错:
mongos> db.businessInfo.drop();
2016-08-14T09:06:58.324+0800 E QUERY Error: drop failed: {
"code" : 13331,
"ok" : 0,
"errmsg" : "exception: collection‘s metadata is undergoing changes. Please try again."
}
at Error (<anonymous>)
at DBCollection.drop (src/mongo/shell/collection.js:620:15)
at (shell):1:12 at src/mongo/shell/collection.js:620
理了一下逻辑,应该先drop sharding collection然后再启用balancer.
本文出自 “努力奔向前方” 博客,请务必保留此出处http://liucb.blog.51cto.com/3230681/1837811
原文地址:http://liucb.blog.51cto.com/3230681/1837811