Synchronization of CentOS system time

Source: Internet
Author: User

1. When your site architecture involves multiple servers, the time between servers must be synchronized, which involves the accuracy of the time of the program, especially the time-related operations and the timing tasks of the system itself.

2. Time Synchronization tool: Ntpdate, installation method: Yum install-y ntpdate

3. How to use: Ntpdate time.windows.com, synchronize the time of the server you want to sync

Servers that can be synchronized:

Time.nist.gov
Time.nuri.net
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org
asia.pool.ntp.org

4. How to synchronize time:

1): The first is to set the scheduled tasks, scheduled to run ntpdate command update time */10 * * * * ntpdate time.nist.gov

2): Configure/etc/ntp.conf file: Run cat/etc/ntp.conf |awk ' {if ($!~/^$/&& $!~/^#/) {print $}} ' command to view configuration

Restrict default ignore//does not allow modification or querying of NTP, and does not receive special packets
Restrict 127.0.0.1//Give all permissions to this machine
Restrict 192.168.1.0 mask 255.255.255.0 notrap nomodify//The machine has synchronization time permissions to the LAN machine
Server time.nist.gov prefer//Set time server, plus prefer for priority
Server 0.asia.pool.ntp.org
Server 1.asia.pool.ntp.org
Server 2.asia.pool.ntp.org
Server 127.127.1.0 # Local clock
Fudge 127.127.1.0 Stratum 10
Driftfile/var/lib/ntp/drift
Keys/etc/ntp/keys

3) When the configuration is complete, start the service:/ETC/INIT.D/NTPD start

4) View sync: NTPQ-PN

Synchronization of CentOS system time

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.