mongodb分片环境搭建启动mongos报错
如下:
[root@mongo2 mongos]# /var/mongo/bin/mongos -f /var/mongo/mongos_1.confabout to fork child process, waiting until server is ready for connections.
forked process: 2646
ERROR: child process failed, exited with error number 5
错误日志如下:
2016-02-15T16:20:07.300+0800 I CONTROL [main] ** WARNING: You are running this process as the root user, which is not recommended.
2016-02-15T16:20:07.300+0800 I CONTROL [main]
2016-02-15T16:20:07.301+0800 I SHARDING [mongosMain] MongoS version 3.2.1 starting: pid=2612 port=60000 64-bit host=mongo2 (--help for usage)
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] db version v3.2.1
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] allocator: tcmalloc
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] modules: none
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] build environment:
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] distmod: rhel62
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] distarch: x86_64
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] target_arch: x86_64
2016-02-15T16:20:07.301+0800 I CONTROL [mongosMain] options: { config: "/var/mongo/mongos_1.conf", net: { port: 60000 }, processManagement: { fork: true }, sharding: { configDB: "192.168.1.74:50000,192.168.1.69:50000,192.168.1.63:50000" }, systemLog: { destination: "file", path: "/var/data/mongos/mongos.log" } }
2016-02-15T16:20:07.301+0800 I SHARDING [mongosMain] Updating config server connection string to: 192.168.1.74:50000,192.168.1.69:50000,192.168.1.63:50000
2016-02-15T16:20:07.315+0800 I NETWORK [mongosMain] SyncClusterConnection connecting to [192.168.1.74:50000]
2016-02-15T16:20:07.316+0800 I NETWORK [mongosMain] SyncClusterConnection connecting to [192.168.1.69:50000]
2016-02-15T16:20:07.317+0800 I NETWORK [mongosMain] SyncClusterConnection connecting to [192.168.1.63:50000]
2016-02-15T16:20:07.373+0800 E SHARDING [mongosMain] Error initializing sharding system: DistributedClockSkewed clock skew of the cluster 192.168.1.74:50000,192.168.1.69:50000,192.168.1.63:50000 is too far out of bounds to allow distributed locking.
原因是由于mongo分片服务器时间差距大导致的,调整服务器时间一致,再次启动ok