hghac集群服务器时间同步(chrony同步)

📅 2026/6/24 9:11:06
hghac集群服务器时间同步(chrony同步)
文章目录环境文档用途详细信息环境系统平台银河麒麟龙芯svs,银河麒麟 X86_64,银河麒麟 飞腾,银河麒麟 鲲鹏,银河麒麟 海光,银河麒麟 龙芯版本4.5文档用途1、hghac集群使用etcd或者zookeeper监控组件需要监控组件所在服务器时间一致才能保障hghac集群的高可用性和稳定性对于时间不一致的服务器需要做时间同步。2、银河麒麟系统默认安装了chrony同步工具相对于其他的时间同步工具chrony是轻量级的时间同步工具具有更加先进的算法更高的时间精度和稳定性以及chrony配置相对简单下文介绍如何使用chrony工具做时间同步。详细信息1、确定已经安装rpm包[rootdsmart ~]# rpm -qa | grep chrony chrony-3.4-1.el7.x86_642、服务端配置vim /etc/chrony.conf # Allow NTP client access from local network. #allow x.x.0.0/16 allow x.x.10.44/23 ##允许哪些客户端来同步主机的时间 # Serve time even if not synchronized to a time source. local stratum 10 ##本机不同步任何主机时间本机作为时间源 systemctl restart chronyd.service ##重启配置文件3、客户端配置vim /etc/chrony.conf #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst server x.x.10.60 iburst ##本机同步x.x.10.60主机的时间 systemctl restart chronyd.service ##重启配置文件4、客户端查看时间同步源chronyc sources -v 210 Number of sources 1 .-- Source mode ^ server, peer, # local clock. / .- Source state * current synced, combined , - not combined, | / ? unreachable, x time may be in error, ~ time too variable. || .- xxxx [ yyyy ] /- zzzz || Reachability register (octal) -. | xxxx adjusted offset, || Log2(Polling interval) --. | | yyyy measured offset, || \ | | zzzz estimated error. || | | \ MS Name/IP address Stratum Poll Reach LastRx Last sample ^* x.x.10.60 2 6 17 33 3518ns[ 24us] /- 15ms5、注意事项01、工具默认使用123/UDP端口协议若没有关闭防火墙请开通udp 123端口号02、涉密机时间修改之后时间一会又跳回去了解决办法安全卡时间同步关掉。