设为首页 加入收藏

TOP

MongoDb不能同步之服务器时间不一致的问题
2014-11-24 01:08:22 来源: 作者: 【 】 浏览:5
Tags:MongoDb 不能 同步 服务器 时间 一致 问题

MongoDb不能同步,可能是服务器时间不一致
今天发现储存在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 www.2cto.com
我水平比较低,只好使用 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 进行校时后,正常。
作者 飘风之鹰
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇并发编程(四):也谈谈数据库的.. 下一篇OCM_Session1_7_SchemaCreation

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: