1、列出所有的Shard Server
- >db.runCommand({listshards:1})--列出所有的ShardServer
- {
- "shards":[
- "_id":"shard0000",
- "host":"localhost:20000"
- },108); list-style:decimal-leading-zero outside; color:inherit; line-height:21px; margin:0px!important; padding:0px 3px 0px 10px!important"> "_id":"shard0001",248); line-height:21px; margin:0px!important; padding:0px 3px 0px 10px!important"> "host":"localhost:20001"
- }
- ],
- "ok":1
- }
- >printShardingStatus()--查看Sharding信息
- ---ShardingStatus---
- shardingversion:{"_id":1,"version":3}
- shards:
- {"_id":"shard0000","host":"localhost:20000"}
- {"_id":"shard0001","host":"localhost:20001"}
- databases:
- {"_id":"admin","partitioned":false,"primary":"config"}
- {"_id":"test","partitioned":true,"primary":"shard0000"}
- test.userschunks:
- shard00001
- {"_id":{$minKey:1}}-->>{"_id":{$maxKey:1}}on:
- shard0000{"t":1000,"i":0}
- >