NTP time synchronization Server configuration

Source: Internet
Author: User

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

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.