Install Chrony
1. Install Chrony
yum install chrony -y
Start the chronyd process
systemctl start chronyd.service
systemctl enable chronyd.service
Check the chronyd process status
systemctl status chronyd.service
Firewalld settings
firewall-cmd --add-service=ntp --permanent
firewall-cmd --reload
Placement Chrony
chrony configuration file/etc/chrony.conf
# Use the public server in the pool.ntp.org project. Starting with a server, in theory, you can add as many time servers as you want.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
Server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos iBurst .pool.ntp.org
server 3.centos.pool.ntp.org iBurst # is calculated according to the ratio of the actual time the server changes in time, and then recorded to a file, the system made after the system reboots for the best time Compensation adjustment. The driftfile / var / lib / the chrony / Drift # chronyd slow down or speed according to the needs time to adjust, # in some cases a system clock may drift too quickly, resulting in too long a time adjustment. # This instruction forces the chronyd adjustment period. When it is greater than a certain threshold, it adjusts the system clock step by step. # Only take effect when there are no more clock updates due to the chronyd startup time exceeding the specified limit (negative values can be used to disable the limit). 1.0. 3 makestep # enables a kernel mode, in this mode, the system for 11 minutes each time are copied to the real-time clock (RTC). rtcsync
All ON the Enable Hardware timestamping do # the interfaces that Support IT.
# Enabled by using a hardware timestamp hwtimestamp instruction
#hwtimestamp eth0
#hwtimestamp eth1
#hwtimestamp * # Increase The Minimum Number of Sources of the appropriate selectable required to ADJUST # The System Clock. #Minsources 2 # specify a host, subnet, or to allow or deny the network connection to the machine plays NTP server clock #allow 192.168.0.0/16 #deny 192.168 / 16 # Serve, the synchronized Time Not to the even IF a Time Source. local Stratum 10 # specify the file that contains the NTP authentication keys. /etc/chrony.keys #keyfile # specify the directory log files. logdir / var / log / the chrony # Which the Select Information IS logged.
#log measurements statistics tracking
Check the chrony configuration source We can use the command to confirm the current time source used by chrony:
chronyc sources
chronyc
Statistical tools for each source, such as using the sourcestats
command to get the drift rate and offset estimates.
chronyc sourcestats
If your system is not connected to the Internet, you need to tell Chrony that the system is not connected to the Internet. To do this, run:
chronyc offline
To check the status of the NTP source, just run:
chronyc activity
Once you are connected to the Internet, just use the command to tell Chrony that your system is back online:
chronyc online
System clock under forced synchronization
chronyc -a makestep
Calibration time server
chronyc tracking