CentOS Server Ntpdate Synchronization

Source: Internet
Author: User
Tags centos server

If more than one CentOS server is running the same service, and the time accuracy requirement is high, it is necessary to ensure that more than one server time is unified.

The simplest is that each server uses Ntpdate to synchronize the time of the same network time server.

1, input ntpdate time.nist.gov synchronization Network Time
[Email protected] ~]# ntpdate time.nist.gov
Mon Dec 17:11:43 ntpdate[5014]: Adjust time server 207.200.81.113 offset-0.018788 sec
# #如果出现上面的内容说明同步成功了, can open Beijing time to see, 1 seconds is not bad
Note: If the prompt command does not exist, direct input: Yum install ntp-y installs the NTP package.

2, set crontab scheduled tasks, so that their timing automatically synchronized
Enter the command crontab-e, press the keyboard letter "I" to enter the editing state, and then copy any of the following plan contents as required into it, press the keyboard "ESC" and enter ": wq!" Save it.
[Email protected] ~]# CRONTAB-E
#每隔1小时同步一次
* */1 * * * * ntpdate time.nist.gov
Or
#每周六凌晨1点同步一次
0 1 * * 6 ntpdate time.nist.gov
If the above time.nist.gov server is not synchronized, you can change the following several times the server to try:
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

CentOS Server Ntpdate Synchronization

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.