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).