我在不同的服务器上有三个 mongod 分片进程和三个 mongod 配置服务器。
部署:
ShardA在服务器192.168.2.101、192.168.2.102、192.168.2.163,三个shard为replica set,192.168.2.102为Arbiters
配置:A. 192.168.2.101
XXXX@ubuntu:~$ ps aux | grep mongo
root 22651 0.2 2.5 899768 46944 ? Sl 12:35 0:10 mongod -shardsvr -replSet shardA -port 27017 -dbpath /var/lib/mongodb/shardA1 -oplogSize 100 -logpath /var/log/mongodb/shardA1.log -logappend -fork
root 22710 0.2 2.5 236084 47512 ? Sl 12:35 0:08 mongod -configsvr -dbpath /var/lib/mongodb/config -port 20000 -logpath /var/log/mongodb/config.log -logappend -fork
B. 192.168.2.102
XXXXX@ubuntu:~$ ps aux | grep mongo
root 10556 0.2 1.0 262468 38688 ? Sl 13:07 0:04 mongod -shardsvr -replSet shardA -port 27017 -dbpath /var/lib/mongodb/shardA3 -oplogSize 100 -logpath /var/log/mongodb/shardA3.log -journal -logappend -fork
root 10583 0.2 0.5 113940 21848 ? Sl 13:07 0:03 mongod -configsvr -dbpath /var/lib/mongodb/config -port 20000 -logpath /var/log/mongodb/config.log -logappend -fork
C. 192.168.2.163
XXXXX@ubuntu:~$ ps aux | grep mongo
root 5594 0.3 0.7 804604 30952 ? Sl 10:45 0:21 mongod -shardsvr -replSet shardA -port 27017 -dbpath /var/lib/mongodb/shardA2 -oplogSize 100 -logpath /var/log/mongodb/shardA2.log -logappend -fork
root 5650 0.2 0.7 134652 29456 ? Sl 10:45 0:19 mongod -configsvr -dbpath /var/lib/mongodb/config -port 20000 -logpath /var/log/mongodb/config.log -logappend -fork
我在服务器192.168.2.102上启动 mongos ,但启动失败
命令是:
sudo mongos -configdb 192.168.2.101:20000,192.168.2.163:20000,192.168.2.102:20000 -port 30000 -chunkSize 256 -logpath $LOGPATH/mongos.log -logappend -fork
日志输出是:
XXXXX@ubuntu:~$ cat /var/log/mongodb/mongos.log
Tue Mar 19 13:10:16 [mongosMain] MongoS version 2.2.3 starting: pid=10666 port=30000 32-bit host=ubuntu (--help for usage)
Tue Mar 19 13:10:16 [mongosMain] git version: f570771a5d8a3846eb7586eaffcf4c2f4a96bf08
Tue Mar 19 13:10:16 [mongosMain] build info: Linux bs-linux32.10gen.cc 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_49
Tue Mar 19 13:10:16 [mongosMain] options: { chunkSize: 256, configdb: "192.168.2.101:20000,192.168.2.163:20000,192.168.2.102:20000", fork: true, logappend: true, logpath: "/var/log/mongodb/mongos.log", port: 30000 }
Tue Mar 19 13:10:16 [mongosMain] ERROR: config servers 192.168.2.101:20000 and 192.168.2.163:20000 differ config servers 192.168.2.101:20000 and 192.168.2.163:20000 differ config servers 192.168.2.101:20000 and 192.168.2.163:20000 differ config servers 192.168.2.101:20000 and 192.168.2.163:20000 differ config servers not in sync! config servers 192.168.2.101:20000 and 192.168.2.163:20000 differ
chunks: "d41d8cd98f00b204e9800998ecf8427e" EOO
databases: "0195c739c938fdafd9632279694ea64e" EOO
Tue Mar 19 13:10:16 [mongosMain] configServer connection startup check failed
错误信息是:配置服务器 192.168.2.101:20000 和 192.168.2.163:20000 不同,这是什么意思?
谢谢 !