建立 分片
db.runCommand({"addshard":"127.0.0.1:27022", allowLocal:true, name:"s1"})
激活数据库分片
db.runCommand( { enablesharding : "test"} );
分片collection , 没有 实际的 collection 存在时,同样可以执行。不过貌似无效。
db.runCommand( { shardcollection : "test.c1",key : {"_id": 1} } )
Listing shards
db.runCommand( { listshards : 1 } )
从mongodb移除分片