NoSQL
发布时间:2022-05-24 发布网站:大佬教程 code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Nosql Mongodb之旅(28)—MongoDB管理维护Sharding,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
1、列出所有的Shard Server
- >db.runcommand({Listshards:1})--列出所有的ShardServer
- {
- "shards":[
- "_ID":"shard0000",
@H_301_32@ "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"
- }
@H_301_32@ ],
- "ok":1
@H_301_32@ }
2、查看Sharding信息
>printShardingStatus()--查看Sharding信息
@H_301_32@ ---ShardingStatus---
- shardingversion:{"_ID":1,"version":3}
@H_301_32@ shards:
- {"_ID":"shard0000","host":"localhost:20000"}
@H_301_32@ {"_ID":"shard0001","host":"localhost:20001"}
- databases:
@H_301_32@ {"_ID":"admin","partitioned":false,"priMary":"config"}
- {"_ID":"test","partitioned":true,"priMary":"shard0000"}
@H_301_32@ test.userschunks:
- shard00001
@H_301_32@ {"_ID":{$minKey:1}}-->>{"_ID":{$maxKey:1}}on:
- shard0000{"t":1000,"i":0}
@H_301_32@ >
大佬总结
以上是大佬教程为你收集整理的Nosql Mongodb之旅(28)—MongoDB管理维护Sharding全部内容,希望文章能够帮你解决Nosql Mongodb之旅(28)—MongoDB管理维护Sharding所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。