我正在尝试从证明的分片中删除一些数据的遗骸 太慢而无用。一些编程错误产生了一堆具有虚假名称的数据库:
mongos> db.runCommand( { removeShard: "shard0002" });
{
"msg" : "draining ongoing",
"state" : "ongoing",
"remaining" : {
"chunks" : NumberLong(0),
"dbs" : NumberLong(30)
},
"note" : "you need to drop or movePrimary these databases",
"dbsToMove" : [
"*�\u000f",
"M�\u0006",
"ed_tione_tr�\u0002",
"sns�\u0002",
"sns�\u0002",
"sns�\u0002",
"sns�\u0002",
"sns�\u0002",
"sns�\u0002",
"sn�\u0002",
"sn�\u0002",
"sn�\u0002",
"sn�\u0002",
"sn�\u0002",
"sn�\u0002",
"sn�\u0002",
"s�\u0002",
"s�\u0002",
"�\u0002",
"�\u0003",
"�\u0006",
"�%\u0003",
"��\r",
"�\u0007",
"�\u0002",
"�\u0002",
"�\u0002",
"�\u0002",
"�\u0002",
"�\f"
],
"ok" : 1
}
我访问名称,我无法输入:
mongos> var k = db.runCommand( { removeShard: "shard0002" });
mongos> var n = k.dbsToMove
但是,即使这对我没有帮助:
mongos> db.adminCommand({ movePrimary: n[10],to : "shard0001" });
{ "ok" : 0, "errmsg" : "can't find db!" }
我正在运行mongodb 2.6.7,摆脱这个无用的碎片是一回事 防止轻易升级。
答案 0 :(得分:2)
最后,我这样做了:
use config
db.shards.remove({"_id":"shard0002"});
因为我关心的所有数据都已经耗尽了。现在我还有两个碎片需要耗尽,而且他们还有垃圾数据库,幸运的是不是那些无法解决的数据库。
我仍然想要了解如何删除这些垃圾数据库的更好答案。