Linux Time Synchronization Configuration tutorial

Source: Internet
Author: User

Production environment associated host often requires consistent time, if there is an NTP time synchronization server, you can configure each host and time synchronization server synchronization time.

1 server-side configuration
1.1 installation ntpd

Yum Install-y NTP

1.2 Configuring the Ntp.conf file

Cat >/etc/ntp.conf <<eof# Restrict lines and-6 lines respectively deny IPv4 and IPv6 user sync restrict default kod nomodify notrap nopeer noqueryrestrict-6 default Kod nomodify notrap nopeer noqueryrestrict 127.0.0.1restrict-6:: # Allow 192.168 network segments for time synchronization restrict 192.168.0.0 Mask 255.255.0.0 nomodify notrap# The NTP server's upper NTP server, instead of its own server 192.168.1.1# the following two sentences for no upper layer when enable self time for the quasi #server 127.127.1.0#fudge 127.127.1.0 stratum 10# The time difference between the upper service and the native motherboard clock is recorded in this file driftfile/var/lib/ntp/driftkeys/etc/ntp/keyseof
1.3 Restarting the NTP service
Chkconfig ntpd onservice ntpd Restart


2 Client Configuration

To install the NTP client:

Yum Install Ntpdate

Sync Time:

Ntpdate 192.168.160.2

Configure the Timed Sync task to execute CRONTAB-E as root and enter the following in the paged out VI:

0 1 * * *  /usr/sbin/ntpdate 192.168.160.2

Note: The five values in the front are sub-/time/day/month/week, * denotes any.

Linux Time Synchronization Configuration tutorial

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.