NAME mongos - MongoDB Sharded Cluster Query Router

SYNOPSIS mongos for "MongoDB Shard," is a routing service for MongoDB shard configurations that processes queries from the application layer, and determines the location of this data in the sharded cluster, in order to complete these operations. From the perspective of the application, a mongos instance behaves identically to any other MongoDB instance.

CONSIDERATIONS Never change the name of the mongos binary.


Mongo Document 3.4

Config servers store the metadata for a sharded cluster. The metadata reflects state and organization for all data and components within the sharded cluster. The metadata includes the list of chunks on every shard and the ranges that define the chunks.

The mongos instances cache this data and use it to route read and write operations to the correct shards. mongos updates the cache when there are metadata changes for the cluster, such as Chunk Splits or adding a shard. Shards also read chunk metadata from the config servers.

The config servers also store Authentication configuration information such as Role-Based Access Control or internal authentication settings for the cluster.

MongoDB also uses the config servers to manage distributed locks.

Each sharded cluster must have its own config servers. Do not use the same config servers for different sharded clusters.

Document - Config Server


要告訴mongos

  • 誰是 config server mongos --configdb configServer
  • 誰是 shard server
    • > sh.addShard('mongodServer')
    • > sh.enableSharding('dbName')
    • > sh.shardCollection('dbName.coll', {'field':1})

results matching ""

    No results matching ""