CentOS server ntpdate Synchronization
If multiple CentOS servers run the same service and have high requirements on time accuracy, the time of multiple servers must be consistent.
The simplest thing is that each server uses ntpdate to synchronize the Time of the same network time server.
1. Input ntpdate time.nist.gov to synchronize the Network Time
[Root @ localhost ~] # Ntpdate time.nist.gov
Mon Dec 17:11:43 ntpdate [5014]: adjust time server 207.200.81.113 offset-0.018788 sec
# If the above content shows that the synchronization is successful, you can open Beijing time to see if it is 1 second.
Note: If the command does not exist, enter "yum install ntp-y" to install the ntp package.
2. Set crontab to schedule tasks and make them automatically synchronized at regular intervals.
Enter the crontab-e command, press "I" on the keyboard to enter the editing status, copy any of the following content to the plan as required, press "ESC" on the keyboard, and enter ": wq!" Save it.
[Root @ localhost ~] # Crontab-e
# Synchronize once every 1 hour
**/1 *** ntpdate time.nist.gov
Or
# Synchronization every Saturday
0 1 ** 6 ntpdate time.nist.gov
If the above time.nist.gov server cannot be synchronized, you can try the following time servers:
Time.nist.gov
Time.nuri.net
0.asia.pool.ntp.org
1.asia.pool.ntp.org
2.asia.pool.ntp.org
3.asia.pool.ntp.org