MongoDB Configuring multiple ConfigDB issues (note)

Source: Internet
Author: User
Tags mongorestore

There is only one configserver and one mongos in the cluster because there is no planning to do before the cluster is deployed. Many configserver are recommended on the Internet, I found in the process of using the MONGOs process, the CONGFIGDB parameter configuration configdb need to be an odd number (such as: 1, 3, 5 ...). OK configure three Configserver bar (one already exists, logging the configuration information of the cluster). Start the MONGOs process and immediately find the error message:

Config servers not in sync! Config Servers * * * and * * differ

According to the literal meaning, the information of these several configuration libraries is not synchronized. Workaround: Import the data for the existing configuration library into several other libraries. The action script is as follows:

1, export data, Mongodump.exe 192.98.12.60:50001-d config to generate backup information, by default in the command execution directory under a Dump folder, the Dump folder to generate some data config library, Save in Bson format,

Specific as indicated:

2. Import Backup data:

Mongorestore.exe--port 50003--db config dump/config

Mongorestore.exe--port 50004--db config dump/config

3. Restart MONGOs

Mongos.exe-f c.conf

Where the c.conf configuration content is as follows:

#route. Confconfigdb=192.98.12.60:50001,192.98.12.60:50003,192.98.12.60:50004logpath=  Route1.logpidfilepath=route1.pidport=50002

OK, all normal, the cluster can start normally (if you configure multiple MONGOs, you can copy the above configuration file more than one, then modify the different ports, and then execute different mongos commands, you can start multiple MONGOs).

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.