No server suitable for synchronization found in Linux.

There are a lot of solutions on the web for Linux synchronization systems to synchronize nTPDate errors, but none of them have been well resolved.

No server suitable for synchronization found after using ntpdate {ntp-server-ip} Finally, it is found that the udp port is shielded in the machine room, because nTPDate uses UDP123 port to synchronize time.

Since NTP is not good, then we use Rdate, can completely solve the time synchronization problem caused by the shielding of UDP ports in some high defense computer rooms in China.

Centos system installation method:

yum install rdate
Copy the code

Ubuntu Debian installation method

apt-get install rdate
Copy the code

After the installation is complete, run the command

/usr/bin/rdate -s time.nist.gov
Copy the code

Time synchronization is now complete. Then, the synchronization task is added to the scheduled task. The synchronization task is performed every 10 minutes

crontab -e
Copy the code

Command to edit crontab scheduled task, put

*/10 * * * * /usr/bin/rdate -s time.nist.gov
Copy the code

Add it to the task and save it at :wq.

However, rdate also has disadvantages. It is not as accurate as NTPDate. Therefore, we need to add a scheduled task to make it synchronize time again within a certain period of time to ensure time accuracy.