MongoDb不能同步,可能是服务器时间不一致
2012-03-31 18:03
232 查看
今天发现储存在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 进行校时后,正常。
更权威的服务器: pool.ntp.org
复旦大学:ntp.fudan.edu.cn
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 进行校时后,正常。
更权威的服务器: pool.ntp.org
复旦大学:ntp.fudan.edu.cn
相关文章推荐
- Mongodb分片时,两台服务器时间不同步caught exception while doing balance: error checking clock skew of cluster
- 138的同学们,空间提供商的服务器出了问题,正在想办法解决,将可能有一周的时间不能上同学录
- 在 Windows Server 2003 中尝试与非 Windows NTP 服务器同步时,时间同步可能失败
- JWT的问题记录:关于授权服务器的时间同步问题
- 用w32tm设置服务器时间同步
- RHEL7 -- 使用Chrony设置时间与时钟服务器同步
- 此服务器上的时间与主域控制器的时间不一致解决方法
- 集群服务器同步时间
- 通达OA 不能登录之服务器时间差异过大
- cas服务器时间不同步导致两台服务器
- Linux 服务器时间同步
- jenkins中subversion由于服务器时间不一致导致无法更新到最新svn的解决方法
- 设置服务器同步时间批处理脚本-Linux篇
- WCF 客户端与服务器时间不同步无法连接的解决方法
- android开发中布局和代码块不能同步(可能findViewById找不到对应布局的id),这是因为安装的android stodio没有设置自动!
- 解决Mongodb不能连接到服务器的问题
- crontab同步各服务器时间
- 配置同步时间服务器
- 服务器时间同步
- 集群服务器 时间同步 - Chrony