44问答网
所有问题
【chrony】CentOS7.2 上chrony的安装与配置
如题所述
举报该问题
其他回答
第1个回答 2022-07-26
NTP:Network Time Protocol 网络时间协议
Chrony 应用本身已经有几年了,其是是网络时间协议的 (NTP) 的另一种实现。
Chrony可以同时做为ntp服务的客户端和服务端
一直以来众多发行版里标配的都是ntpd对时服务,自rhel7/centos7 起,Chrony做为了发行版里的标配服务,不过老的ntpd服务依旧在rhel7/centos7里可以找到 。
Chrony有两个核心组件:
chronyd:是守护进程,主要用于调整内核中运行的系统时间和时间服务器同步。它确定计算机增减时间的比率,并对此进行调整补偿。
chronyc:提供一个用户界面,用于监控性能并进行多样化的配置。它可以在chronyd实例控制的计算机上工作,也可以在一台不同的远程计算机上工作。
chrony用来同步时间,来代替ntp服务,优点是很精巧的时间同步工具,更快响应时钟变化,在应对延时提供更好的稳定性能,不会出现时间空白,跨越互联网同步时间只需要几毫秒。
操作系统: CentOS7.x
chronyServer 192.168.1.106
chronyClient 192.168.1.100
在chronyServer 和chronyClient 服务器:
# yum -y install chrony
# rpm -ql chrony
开启防火墙
# firewall-cmd --add-service=ntp --permanent
# firewall-cmd --reload
关闭selinux
# setenforce 0
# sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
在chronyServer服务器:
# vim /etc/chrony.conf
#########################
server pool.ntp.org iburst prefer
server 192.168.1.106 iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
allow 192.168.1.0/24
local stratum 10
logdir /var/log/chrony
bindaddress 192.168.1.106
port 123
###############################
# systemctl start chronyd
# systemctl enable chronyd
# systemctl status chronyd
查看服务端绑定的IP和端口监听
# ss -uan
chronyd默认监听两个端口: 123/udp 323/udp
123/udp ,是供客户端通讯连接用的,安全起见,请绑定服务端socket的IP,而不是0.0.0.0
323/udp,供chronyc连接用,安全起见,默认绑定的本地socket的IP为 127.0.0.1
在chronyClient服务器:
# vim /etc/chrony.conf
################################
server 192.168.1.106 iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony
bindacqaddress 192.168.1.100
acquisitionport 1234
#######################################
# systemctl start chronyd
# systemctl enable chronyd
# systemctl status chronyd
# ss -uan
注意:chrony作为客户端是采用随机的udp端口与服务端进行通讯的,但是我们可以绑定客户端socket的的IP和端口,以便于相应的防火墙管理控制,,本客户端,我们配置的与服务端通讯的端口为 1234。
# watch chronyc tracking
Chrony Introduction
https://chrony.tuxfamily.org/
https://wiki.archlinux.org/index.php/Chrony
chrony.conf(5) Manual Page
https://chrony.tuxfamily.org/
doc/3.4/chrony.conf.html
CentOS / RHEL 7 : Chrony V/s NTP (Differences Between ntpd and chronyd)
https://www.thegeekdiary.com/centos-rhel-7-chrony-vs-ntp-differences-between-ntpd-and-chronyd/
CHAPTER 17. CONFIGURING NTP USING THE CHRONY SUITE
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-configuring_ntp_using_the_chrony_suite
CentOS 7.x中正确设置时间与时钟服务器同步
https://linux.cn/article-4764-1.html
https://www.jianshu.com/p/a8cc55c894e9?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
chronyd Can't synchronise: no majority
https://forums.fedoraforum.org/showthread.php?298929-Automatic-time-set
CentOS / RHEL 7 : How to sync chrony to local clock
https://www.thegeekdiary.com/centos-rhel-7-chrony-how-to-sync-to-local-clock/
Manage NTP with Chrony
https://opensource.com/article/18/12/manage-ntp-chrony
Chrony:一个类 Unix 系统上 NTP 客户端和服务器替代品
https://linux.cn/article-10250-1.html
How to Install and Use Chrony in Linux
https://www.tecmint.com/install-chrony-in-centos-ubuntu-linux/
相似回答
Linux时间服务(ntp
和chrony
)
答:
接下来是实践操作。在Linux服务器上,可以通过调整/etc/ntp.conf来配置ntpd,如允许特定IP、设置限制、指定UTC源,并启用服务。客户端则需
安装
ntp服务,编辑配置文件添加新的时间服务器,定期同步。而
chrony的配置
更简洁,只需管理/etc/chrony.conf,并启用开机自启动。时间服务的命令行工具如ntpq
和chrony
c...
【ntp】为什么ntp服务需要开启双向(服务器端和客户端) udp/123端口...
答:
http://support.ntp.org/bin/view/Support/TroubleshootingNTP
【chrony】CentOS7.2
上chrony的安装与配置
https://www.jianshu.com/p/a8976ed21422 【ntp】CentOS7.x ntpd作为ntpServer ntpClient 的安装配置 https://www.jianshu.com/p/8513a4bbd257 【systemd+iptables】用systemd定义一个iptables...
chrony
时间同步
答:
重启下服务端
chrony
服务,使用systemctl restart chronyd.service重启即可。2、客户端
配置
配置文件修改vim /etc/chrony.conf a、修改server即可,删掉其他的,添加要同步时间的源服务器ip,格式如下:server x.x.x.x iburst 重启下客户端chrony服务,使用systemctl restart chronyd.ser...
怎么停止Rhel7 上的时间服务器
chrony
d
答:
service
chrony
d stop 如果你想永远禁用就用 /bin/systemctl disable chronyd.service
大家正在搜
redhat配置chrony
下载的安装包为什么安装不上
chrony安装
chrony服务端配置
chrony工具安装
Linux的chronyc
chrony配置
chrony和ntp区别
chrony的优势