1th. NTP time server Setup 1.1ntp Introduction
NTP (networktime Protocol, Network Time Protocol) is a protocol that is used to synchronize the time of each computer in a network. Its purpose is to synchronize the computer clock to the World coordinated UTC, its accuracy in the LAN up to 0.1ms, in most places on the Internet its accuracy can reach 1-50ms.
NTP the server is using the NTP protocol to provide time Synchronization services.
1.2NTP Server Installation
1. # System comes with NTP
2. [[email protected] ~]# Rpm-qa NTP
3. ntp-4.2.6p5-5.el6.centos.x86_64
4. # if not, install
5. Yum-y Install NTP
1.3 Configuring the NTP time server
[Email protected] ~]# vim/etc/ntp.conf
# Restrict default Kod nomodifynotrap nopeer noquery
Restrict default nomodify
# nomodify clients can synchronize
# Use The default time synchronization source comment instead of the available source
# server 0.centos.pool.ntp.orgiburst
# server 1.centos.pool.ntp.orgiburst
# server 2.centos.pool.ntp.orgiburst
# server 3.centos.pool.ntp.orgiburst
Server ntp1.aliyun.com
Server time.nist.gov
Start NTP Server
[Email protected] ~]#/etc/init.d/ntpdstart
starting NTPD: [ OK ]
[Email protected] ~]# ntpq-p
remote refID St T when poll reach >delay offset jitter
==============================================================================
*ntp1.aliyun.com 10.137.38.86 2 u 1 525.885 -42.367 0.000
[Email protected] ~]# Ntpstat
Synchronised to NTP server (110.75.186.247) at Stratum 3
time correct to within 4257 Ms
Polling server every s
[Email protected] ~]# ntpdate10.0.0.9
7 Dec 18:43:07 ntpdate[26950]: The NTP socketis in use, exiting
1.4 Client time synchronization
The client will wait a few minutes for time synchronization with the newly-started NTP server, otherwise the error is indicated no serversuitable for synchronization found
.
[Email protected] ~]# ntpdate 10.0.0.9
7 Dec 18:40:16 ntpdate[1453]: Step time server10.0.0.9 offset 40.880807 sec
# put the command into a scheduled task.
This article is from "No Lover" blog, please make sure to keep this source http://caojiaoyue.blog.51cto.com/11798573/1934040
Linux NTP time synchronization configuration