Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB Sharding document #430

Merged
merged 18 commits into from
May 4, 2019
Merged

MongoDB Sharding document #430

merged 18 commits into from
May 4, 2019

Conversation

the-redback
Copy link
Contributor

No description provided.

@the-redback the-redback marked this pull request as ready for review April 30, 2019 10:46
@the-redback the-redback changed the title [draft] MongoDB Sharding document MongoDB Sharding document Apr 30, 2019
- ***config servers:*** Config servers store metadata and configuration settings for the cluster. As of MongoDB 3.4, config servers must be deployed as a replica set (CSRS).

<p align="center">
  <img alt="sharded-cluster" src="/docs/images/mongodb/sharded-cluster.png" width="620" height="440">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add source of these images.


The mongos selects the primary shard when creating a new database by picking the shard in the cluster that has the least amount of data. mongos uses the totalSize field returned by the listDatabase command as a part of the selection criteria.

Diagram of a primary shard. A primary shard contains non-sharded collections as well as chunks of documents from sharded collections. Shard A is the primary shard.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is it Diagram of a primary shard.?

- `spec.shardTopology` represents the topology configuration for sharding.
- `shard` represents configuration for Shard component of mongodb.
- `shards` represents number of shards for a mongodb deployment. Each shard is deployed as a [replicaset](/docs/guides/mongodb/clustering/replication_concept.md).
- `replicas` represents number of replicas of each shard replicaset.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means total number of pods = 1 + replicas?

mongodb.kubedb.com/mongo-sh created
```

Here,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the word pod instead of node here to clarify that this is k8s pod (or db node, not k8s node)

- `replicas` represents number of replicas for configServer replicaset. Here, configServer is deployed as a replicaset of mongodb.
- `prefix` represents the prefix of configServer nodes.
- `configSource` is an optional field to provide custom configuration file for configSource (i.e mongod.cnf). If specified, this file will be used as configuration file otherwise default configuration file will be used.
- `podTemplate` is an optional configuration for pods.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to point to a doc that explains the options available to a podTemplate.

Signed-off-by: Tamal Saha <[email protected]>
@tamalsaha tamalsaha merged commit 769adea into master May 4, 2019
@tamalsaha tamalsaha deleted the shard-doc branch May 4, 2019 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants