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