First step to install NTP
Yum Install NTP
Second step, find the closest time synchronization server
Http://www.pool.ntp.org/zone/asia
The third edition of/etc/ntp.conf
Server 127.127.1.0 iburst # Local Clock when the external time server is unavailable, use the native time as the standard for the time service
Fudge 127.127.1.0 Stratum #这个值不能太高0-15, too high will be an error
Fourth Step
Add an IP segment to allow access
Restrict 192.168.1.0 netmask 255.255.255.0 nomodify notrap
Fifth Step Configuring the firewall
Firewall-cmd--ADD-SERVICE=NTP--permanent
Firewall-cmd--reload
Sixth step to start the NTP service
Systemctl Enable NTPD Boot
Systemctl Start NTPD
Sytemctl Status NTPD
Seventh Step Verification Service
Ntpq-p
Date-r
Eighth step
Synchronizing Remote Time Services
Ntpdate-q 0.ro.pool.ntp.org 1.ro.pool.ntp.org
Nineth step in the client machine synchronization time
Ntpdate-d-B 192.168.85.20
Problems that you may encounter
1 centos stratum 0, Precision 0, Leap xx, trust no server suitable for synchronization found
This problem is due to the firewall blocking the NTP port, use on buy your firewall-cmd command to solve
2 problems with stratum too high
To modify the value of stratum in/etc/ntp.conf
3 NTP boot does not start the workaround
This problem is often due to the 123 ports of the NPT service being caused by other service occupancy, which is typically chronyd
Disabling this service can
Systemctl Disable Chronyd
Build an NTP server for CentOS 7