Two ways to synchronize NTP: 1. Synchronize directly with the Ntpdate command 2. Smooth sync with NTPD service
The defect of the direct synchronization method: It will cause the scheduled task to be done again.
The offset of the synchronization time of the smooth synchronization is not too steep, according to the offset, the mean variance equivalent of each synchronization a little bit, synchronization fully synchronized well takes a long time. So generally open NTPD service before synchronization with Ntpdate first manually synchronized once (example: Ntpdate 10.10.5.15)
How to configure Smooth synchronization:
A. Check if the NTP service installs Rpm-q NTP;
B. Configure the NTP service to self-boot chkconfig ntpd on, and check whether to start Chkconfig--list ntpd
NTPD 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
C. Modify the/etc/ntp.conf file
D. The main server to synchronize with is to modify the following statement:
# Allow other machines in the intranet to synchronize time
Restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap #允许192.168.1. The machine of the network segment synchronizes with itself
...
Server 127.127.1.0 # Local clock
Fudge 127.127.1.0 Stratum 10
After change, restart the NTPD service as the root user: Services ntpd restart
E. For clients to synchronize with the master node, the primary is to configure the primary server-side IP
# Configure the time server as a local time server
Server 192.168.1.135 # Configure the servers IP to synchronize with
Restrict 192.168.1.135 nomodify notrap noquery
After change, restart the NTPD service as the root user: Services ntpd restart
F. View the service status with the following command:
1 ntpq–p (view offset, mean square, etc.);
appear similar to:
Remote refID St T when poll reach delay offset jitter
==============================================================================
*node1 LOCAL (0) 2 u 963 1024 377 0.237 0.314 0.040
You can see offset values, polling interval poll, and other information.
2 Ntpstat
appear similar to:
Synchronised to NTP server (172.10.201.62) at Stratum 3
Time correct to within MS
Polling server every 1024x768 s
Indicates that the machine is already synchronized with the IP 172.10.201.62 server and is synchronized every 1024s polling
NTP time synchronization Server configuration