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

相关推荐
少妇的美梦12 小时前
logstash教程
运维
chen94512 小时前
k8s集群部署vector日志采集器
运维
chen94512 小时前
aws ec2部署harbor,使用s3存储
运维
轻松Ai享生活16 小时前
5 节课深入学习Linux Cgroups
linux
christine-rr17 小时前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神55517 小时前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆17 小时前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_2642208917 小时前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++18 小时前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy18 小时前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡