How to check shards?

I am trying to trick MongoDB. I ended up setting up Sharding, but I'm not sure how to check if the splinter works.

How to check how my data is plastered? Is there a request to check / verify fragments?

+3
source share
2 answers

MongoDB has detailed documentation on sharding here ...

http://www.mongodb.org/display/DOCS/Sharding+Introduction

To answer the question (I think), see the section on config Servers ...

Each configuration server has a complete copy of all piece information. Two-phase commit is used to ensure consistency of configuration data among configuration servers.

, , , .

, , query...

db.runCommand({listshards: 1});

...

http://www.slideshare.net/mongodb/mongodb-sharding-internals

http://www.10gen.com/video/mongosv2010/sharding

+5

mongos:

> use admin
> db.printShardingStatus();

, , mongodb

sharding version: { "_id" : 1, "version" : 2 }
  shards:
      { "_id" : ObjectId("4bd9ae3e0a2e26420e556876"), "host" : "localhost:30001" }
      { "_id" : ObjectId("4bd9ae420a2e26420e556877"), "host" : "localhost:30002" }
      { "_id" : ObjectId("4bd9ae460a2e26420e556878"), "host" : "localhost:30003" }

  databases:
    { "name" : "admin", "partitioned" : false,
          "primary" : "localhost:20001",
          "_id" : ObjectId("4bd9add2c0302e394c6844b6") }
    my chunks

        { "name" : "foo", "partitioned" : true,
          "primary" : "localhost:30002",
          "sharded" : { "foo.foo" : { "key" : { "_id" : 1 }, "unique" : false } },
          "_id" : ObjectId("4bd9ae60c0302e394c6844b7") }
        my chunks
        foo.foo { "_id" : { $minKey : 1 } } -->> { "_id" : { $maxKey : 1 } }
                  on : localhost:30002 { "t" : 1272557259000, "i" : 1 }
+14

Source: https://habr.com/ru/post/1783809/


All Articles