1
概述
NTP(Network Time Protocol)是网络时间协议,用来同步网络中各个计算机的时间的协议,客户端向一个或者多个服务端进行时间同步。
在RHEL 7中有两种方法来配置同步客户端。
https://www.cndba.cn/dave/article/1820
(1)ntp: this is the classic package, already existing in RHEL 6, RHEL 5, etc.
(2)chrony: this is a new solution better suited for portable PC or servers with network connection problems (time synchronization is quicker). chrony is the default package in RHEL 7.
https://www.cndba.cn/dave/article/1820
关于ntpd 和chronyd的区别参考红帽官网:
https://www.cndba.cn/dave/article/1820
Chrony consists of chronyd, a daemon that runs in user space, and chronyc, a command line program for making adjustments to chronyd. Systems which are not permanently connected, or not permanently powered up, take a relatively long time to adjust their system clocks with ntpd. This is because many small corrections are made based on observations of the clocks drift and offset. Temperature changes, which may be significant when powering up a system, affect the stability of hardware clocks. Although adjustments begin within a few milliseconds of booting a system, acceptable accuracy may take anything from ten seconds from a warm restart to a number of hours depending on your requirements, operating environment and hardware. chrony is a different implementation of the NTP protocol than ntpd, it can adjust the system clock more rapidly.
Differences Between ntpd and chronyd
One of the main differences between ntpd and chronyd is in the algorithms used to control the computer's clock. Things chronyd can do better than ntpd are:
chronyd can work well when external time references are only intermittently accessible, whereas ntpd needs regular polling of time reference to work well.
chronyd can perform well even when the network is congested for longer periods of time.
chronyd can usually synchronize the clock faster and with better time accuracy.
chronyd quickly adapts to sudden changes in the rate of the clock, for example, due to changes in the temperature of the crystal oscillator, whereas ntpd may need a long time to settle