MongoDb cannot be synchronized, probably because the server time is inconsistent

Source: Internet
Author: User

Today, I found image errors stored in MongoDb GridFS. I checked the logs and found many logs similar to the following:

Sat Mar 31 16:10:45 [conn42882] ns: fangdd. fs. chunks cocould not initialize cursor should SS 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

I had to use ps ax | grep mongo to find out each mongo and mongos process, kill-2 nnn one by one, and then start. In addition, the servers involved in the Cluster also perform the same operation.

After the restart is completed, the following errors are found:

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.

Later, it was found that the time of the server was not exactly the same, and one server was slow for more than 70 seconds.

Sudo ntpdate stdtime.sinica.edu.tw is normal after the school is completed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.