Mongodb Shrading给配置服务器不同步错误?

时间:2015-02-26 10:29:25

标签: mongodb sharding

我在localhost上创建了三个mongodb实例,其中包含不同的端口,如

mongod.exe --configsvr --dbpath C:\MongoDB2.6\mongodb\data --port 2021

mongod.exe --configsvr --dbpath D:\mongodb\data --port 2022

mongod.exe --configsvr --dbpath E:\mongodb\data --port 2023

这3个成功实例化。 现在我使用mongos命令对这三个实例进行clustring,我的命令就像这样

mongos.exe --configdb 127.0.0.1:2021,127.0.0.1:2022,127.0.0.1:2023

BUt它给了我这样的错误

C:\MongoDB2.6\bin>mongos.exe --configdb 127.0.0.1:2021,127.0.0.1:2022,127.0.0.1:2023 --port 2025
2015-02-26T15:51:22.451+0530 [mongosMain] MongoS version 2.6.7 starting: pid=12256 port=2025 64-bit host=triconnode112 (--help for usage)
2015-02-26T15:51:22.451+0530 [mongosMain] db version v2.6.7
2015-02-26T15:51:22.451+0530 [mongosMain] git version: a7d57ad27c382de82e9cb93bf983a80fd9ac9899
2015-02-26T15:51:22.451+0530 [mongosMain] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOO
ST_LIB_VERSION=1_49
2015-02-26T15:51:22.451+0530 [mongosMain] allocator: system
2015-02-26T15:51:22.466+0530 [mongosMain] options: { net: { port: 2025 }, sharding: { configDB: "127.0.0.1:2021,127.0.0.1:2022,127.0.0.1:2023" } }
2015-02-26T15:51:22.482+0530 [mongosMain] warning: config servers 127.0.0.1:2021 and 127.0.0.1:2022 differ
2015-02-26T15:51:22.482+0530 [mongosMain] warning: config servers 127.0.0.1:2021 and 127.0.0.1:2022 differ
2015-02-26T15:51:22.482+0530 [mongosMain] warning: config servers 127.0.0.1:2021 and 127.0.0.1:2022 differ
2015-02-26T15:51:22.498+0530 [mongosMain] warning: config servers 127.0.0.1:2021 and 127.0.0.1:2022 differ
2015-02-26T15:51:22.498+0530 [mongosMain] ERROR: could not verify that config servers are in sync :: caused by :: config servers 127.0.0.1:2021 and 127.0.0.1:20
22 differ: { chunks: "d41d8cd98f00b204e9800998ecf8427e", shards: "d41d8cd98f00b204e9800998ecf8427e", version: "9c051057927f3ebf9b0ee68b4b0ff78d" } vs { chunks:
"d41d8cd98f00b204e9800998ecf8427e", shards: "d41d8cd98f00b204e9800998ecf8427e", version: "4c0907d023ca1c1216c89d83fcb6a841" }
2015-02-26T15:51:22.498+0530 [mongosMain] configServer connection startup check failed

我没有得到我在做错的地方。在这个完整的例子中,实际上我正在尝试为mongodb实现分片。

现在我能够解决这个问题并试图执行shard命令

 sh.addShard("127.0.0.1:2021,127.0.0.1:2022,127.0.0.1:2023")

现在它给了我错误

{
        "ok" : 0,
        "errmsg" : "can't use sync cluster as a shard.  for replica set, have to use <setname>/<server1>,<server2>,..."
}

我不知道为什么会出现这个错误。

0 个答案:

没有答案