zoukankan      html  css  js  c++  java
  • 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

    我水平比较低,只好使用 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

  • 相关阅读:
    批处理学习总结之常用命令1
    Delphi常用数据类型
    Delphi预编译指令总结
    Delphi同步互斥总结
    MyEclipse 环境配置总结
    倒排索引
    laravel 学习相关笔记
    elasticsearch倒排索引原理
    原生sql和 TP sql怎么关联?
    elastic
  • 原文地址:https://www.cnblogs.com/heiing/p/2427478.html
Copyright © 2011-2022 走看看