NoSQL   发布时间:2022-05-24  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Nosql Mongodb之旅(28)—MongoDB管理维护Sharding大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

1、列出所有的Shard Server

[plain] view plain copy
  1. >db.runcommand({Listshards:1})--列出所有的ShardServer
  2. {
  3. "shards":[
  4. "_ID":"shard0000",
  5. @H_301_32@ "host":"localhost:20000"
  6. },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"
  7. }
  8. @H_301_32@ ],
  9. "ok":1
  10. @H_301_32@ }
2、查看Sharding信息
    >printShardingStatus()--查看Sharding信息 @H_301_32@ ---ShardingStatus---
  1. shardingversion:{"_ID":1,"version":3}
  2. @H_301_32@ shards:
  3. {"_ID":"shard0000","host":"localhost:20000"}
  4. @H_301_32@ {"_ID":"shard0001","host":"localhost:20001"}
  5. databases:
  6. @H_301_32@ {"_ID":"admin","partitioned":false,"priMary":"config"}
  7. {"_ID":"test","partitioned":true,"priMary":"shard0000"}
  8. @H_301_32@ test.userschunks:
  9. shard00001
  10. @H_301_32@ {"_ID":{$minKey:1}}-->>{"_ID":{$maxKey:1}}on:
  11. shard0000{"t":1000,"i":0}
  12. @H_301_32@ >

大佬总结

以上是大佬教程为你收集整理的Nosql Mongodb之旅(28)—MongoDB管理维护Sharding全部内容,希望文章能够帮你解决Nosql Mongodb之旅(28)—MongoDB管理维护Sharding所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: