在mongo集群中,各个主机的时间需要一致,否则可能会提示错误。

例如我的3台主机,其中一台超前了约2分钟,创建集合时没问题,但删除时提示如下错误:

> db.csptest2.drop()
Fri Feb 22 08:48:24 uncaught exception: drop failed: {
"errmsg" : "exception: Error locking distributed lock for chunk drop. :: caused by :: 13651 error checking clock skew of cluster 10.0.0.1:39000,10.0.0.2:39000,10.0.0.3:39000 :: caused by :: 13650 clock skew of the cluster 10.0.0.1:39000,10.0.0.2:39000,10.0.0.3:39000 is too far out of bounds to allow distributed locking.",
"code" : 14022,
"ok" : 0
}

将这台主机调整到和其他主机相差在十几秒后,即可执行成功:
> db.csptest2.drop()
true
>

 

 

 

 

 

 

 

相关文章:

  • 2022-01-05
  • 2021-11-08
  • 2022-12-23
  • 2021-06-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-27
  • 2022-12-23
  • 2021-11-27
  • 2021-10-12
相关资源
相似解决方案