Set ntpdate synchronization network time on the CentOS server

Source: Internet
Author: User
Tags centos server
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. enter ntpdatetime.nist.gov to synchronize the network time [root @ localhost ~] # Ntpdatetime. nist. govMonDec17: 11: 43n 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
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.