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、涉密机时间修改之后,时间一会又跳回去了,解决办法:安全卡时间同步关掉。

相关推荐
啊吧怪不啊吧1 小时前
UU远程协助迎来升级!第一期更新实测
运维·服务器·远程工作
C_心欲无痕6 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜6007 小时前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston8 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20188 小时前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟8 小时前
20.部署与运维
运维·docker·容器·.net
HIT_Weston8 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式8 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
期待のcode9 小时前
前后端分离项目 Springboot+vue 在云服务器上的部署
服务器·vue.js·spring boot
AI 智能服务9 小时前
第6课__本地工具调用(文件操作)
服务器·人工智能·windows·php