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

文章目录

环境

系统平台:银河麒麟(龙芯)svs,银河麒麟 (X86_64),银河麒麟 (飞腾),银河麒麟 (鲲鹏),银河麒麟 (海光),银河麒麟 (龙芯)

版本:4.5

文档用途

1、hghac集群使用etcd或者zookeeper监控组件,需要监控组件所在服务器时间一致才能保障hghac集群的高可用性和稳定性,对于时间不一致的服务器需要做时间同步。

2、银河麒麟系统默认安装了chrony同步工具,相对于其他的时间同步工具,chrony是轻量级的时间同步工具,具有更加先进的算法,更高的时间精度和稳定性,以及chrony配置相对简单,

下文介绍如何使用chrony工具做时间同步。

详细信息

1、确定已经安装rpm包

sql 复制代码
[root@dsmart ~]# rpm -qa | grep chrony

chrony-3.4-1.el7.x86_64

2、服务端配置

sql 复制代码
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、客户端配置

sql 复制代码
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、客户端查看时间同步源

sql 复制代码
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] +/-   15ms   

5、注意事项:

01、工具默认使用123/UDP端口协议,若没有关闭防火墙,请开通udp 123端口号

02、涉密机时间修改之后,时间一会又跳回去了,解决办法:安全卡时间同步关掉。

相关推荐
tntxia21 小时前
linux curl命令详解_curl详解
linux
扛枪的书生1 天前
Linux 网络管理器用法速查
linux
SkyWalking中文站1 天前
认识 Horizon UI · 1/17:SkyWalking 新一代可观测性控制台
运维·前端·监控
顺风尿一寸1 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
雪梨酱QAQ1 天前
Kubeneters HA Cluster部署
运维
江华森1 天前
Spring Cloud 微服务全栈实战:从 Eureka 到 Docker Compose 一文贯通
运维
江华森1 天前
Matplotlib 数据绘图基础入门
运维
XIAOHEZIcode1 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
江华森1 天前
NumPy 数值计算基础入门
运维
唐青枫1 天前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux