Home > Database > Mysql Tutorial > MongoDb不能同步,可能是服务器时间不一致

MongoDb不能同步,可能是服务器时间不一致

WBOY
Release: 2016-06-07 17:14:31
Original
1322 people have browsed it

MongoDb不能同步,可能是服务器时间不一致,我水平比较低,只好使用 ps ax | grep mongo 找出每个mongo和mongos进程,一个个地ki

今天发现储存在MongoDb GridFS里的图片错误,查看日志,,发现类似下面的日志非常多:

Sat Mar 31 16:10:45 [conn42882] ns: fangdd.fs.chunks could not initialize cursor across all shards because : ns: mydb.fs.chunks ClusteredCursor::query @ shard2/192.168.222.201:10021,192.168.222.202:10024,192.168.222.202:10022,192.168.222.201:10023 attempt: 3

我水平比较低,只好使用 ps ax | grep mongo 找出每个mongo和mongos进程,一个个地kill -2 nnn,再启动。另外参与群集的服务器上也进行同时的操作。

重启完成后,发现较多如下错误:

Sat Mar 31 17:23:10 [Balancer] caught exception while doing balance: error checking clock skew of cluster 192.168.222.201:20000,192.168.222.201:2001ew of the cluster 192.168.222.201:20000,192.168.222.201:20010,192.168.222.202:20000 is too far out of bounds to allow distributed locking.

后来发现服务器的时间不完全一致,有台服务器慢了70多秒, 运行

sudo ntpdate stdtime.sinica.edu.tw 进行校时后,正常。

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template