加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 服务器 > 系统 > 正文

mongodb-mongos问题详细记录

发布时间:2023-10-25 15:04:03 所属栏目:系统 来源:
导读:mongodb 启动mongos时报以下错误

Error initializing sharding system: DistributedClockSkewed: clock skew of the cluster ambari01:20000,ambari02:20000,ambari03:20000 is too far out of bounds to allow
mongodb 启动mongos时报以下错误
 
Error initializing sharding system: DistributedClockSkewed: clock skew of the cluster ambari01:20000,ambari02:20000,ambari03:20000 is too far out of bounds to allow distributed locking
 
这个错误是各个节点之间时间不同步,以下为设置时间同步方法
 
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  #设置时区为北京时间,这里为上海,因为centos里面只有上海。。。    ntpdate us.pool.ntp.org  #时间同步
 
复制代码
 
没有安装ntpdate的可以yum一下    yum install -y ntpdate   
 
加入定时计划任务,每隔10分钟同步一下时钟   
 
crontab -e    
 
把下面的内容粘贴进去保存即可
 
0-59/10 * * * * /usr/sbin/ntpdate us.pool.ntp.org | logger -t NTP
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章