Mongodb sharding (6): configservers and shards

Source: Internet
Author: User
Tags mongodb sharding

1. When a shard is unavailable, the entire sharding cluster is unavailable. Only the config database can read and write data, and data migration and chunks are stopped.

For example, there are three shard in the cluster. Now I have stopped the shard shard0001 before performing the query operation and found that the operation failed.

It can be seen from this that if a shard only has one mongod process instead of the replSet mode, the entire cluster will be unavailable when the process goes down. Therefore, each shard must be in the replSet mode.

2. Add the down configServer again.

(1) restore its data. Copy one of the running configsServers data directory files.

(2) Start. View mongos logs.

3. Add a new configServer

(1) copy data. Stop a running instance. Copy its data directory file to the data directory of the new configServer. (The selected configServer must be stopped first. The config data is read-only and cannot be changed at this time. In this case, copying is the safest .) Note that the number of configservers is only 1 and 3. Otherwise, an error is reported during startup.

(2) Stop mongs and mongds in sequence.

(3) Start configServers. Check whether logs are started properly. (Including existing and newly added .)

(4) Start mongs and modify the original configdb parameter value.

(5) Start ipvds.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.