Maintenance of NTP server under Linux

Source: Internet
Author: User
Tags current time linux

The NTP server----operation of the Linux real-World Deployment series explains how to deploy a load-balanced and highly available NTP server under a simple architecture. Next, we need to understand the maintenance of the technology, so as to better escort the company's business AH.

NTP server maintenance is divided into 2 parts, the first part of day-to-day management commands and common operations, the second part of the error of the Troubleshooting and solutions

Part I: Management commands

1, Ntpstat command

Ntpstat is a command to see if the NTP server and the upper level are connected

[Root@c64-ntp-1 ~]# Ntpstat
Synchronised to NTP server (202.112.31.197) at Stratum 3
Timecorrect to within Bayi MS
Polling server every S

When a command is executed, a synchronised is present before the connection state is represented. The process needs to be about 5 minutes after startup, why 5 minutes, and the following.

2, NTPQ command

NTPQ is used to monitor NTPD process operations, using the standard NTP mode 6 control message mode and communicating with the NTP server.

NTPQ-P queries the NTP server in the network and displays the current relationship between the NTP server and the superior NTP server.

[Root@c64-ntp-1 ~]# Ntpq-p
Remote refID St T when poll reach delay offset jitter
==============================================================================
+NTP.GLNET.EDU.C 202.112.10.60 2 U 23 64 377 63.481 37.308 16.341
+hshh.org 204.152.184.72 2 U 16 64 377 15.475 33.557 15.059
*dns2.synet.edu. 202.118.1.46 2 U 47 64 377 47.493 35.020 15.339

Detailed options:

Remote: The name of the NTP server that first responded to the request
refID: Refers to a superior NTP server source that provides time synchronization for local NTP servers.
ST: This value is used to represent the layer level of the parent NTP server source. Because NTP is a layered structure, there are top servers, multi-tier NTP server sources, and then to the client. So the server can be set to 1-16 from highest to lowest level. To slow down load and network congestion, you should avoid connecting directly to a tier-level 1 server in principle.
T: This value is used to represent the type of the remote server. There are the following types: U on behalf of unicast or multicast client, b for broadcast or multicast server, l for local (reference clock), s for the sibling NTP server, a for multicast server, b for broadcast server, M for multicast server
When: This value is the current time value from the last time the packet was received
Poll: This value is the polling interval for the local NTP server and the ancestor NTP server source, that is, each time the two parties synchronize once (in seconds). When NTP is first run, the poll value is smaller, and the frequency of synchronization with the parent NTP server source increases, so you can adjust to the correct time range as soon as possible. The poll value is then gradually increased, and the frequency of synchronization decreases accordingly.
Reach: This is a octal value that is used to test whether it can connect to the server. The value of each successful connection increases.
Delay: This value is the round-trip latency of the NTP message for the local NTP server and the ancestor NTP server source.
Offset: This value is the time lag value for the local NTP server and the ancestor NTP server source. The closer the value is to 0, the more accurate the time between us and the superior NTP server source.
Jitter: This value is used to calculate the distribution of the offset (time difference) within a specified number of consecutive connections. The smaller the absolute value of the value, the more accurate the time between us and the superior NTP server source.

Know the role of each parameter, we all may have doubts, I obviously added three superior NTP source server is not these three addresses ah, why here will appear these three addresses?

First, because NTP provides us with a server cluster of cluster servers, it is possible for each connection to get a different server. It also tells us that you should use hostname instead of IP when specifying an NTP server address.

Second, since so many servers are in order to be in a problem when other servers can also be normal to provide us with services. So how do you know the status of these servers? This is the first column of the use of the first character! It will tell us about the server and let us make a judgment.

* It tells us that the remote server has been identified as our main NTP server and that our system time will be provided by this machine
+ It will serve as a secondary NTP server and a server with a * to provide us with synchronization services. It can take over when the * Number server is unavailable.
-The remote server is considered an unqualified NTP server by clustering algorithm (clustering algorithm)
"" (space) an NTP server with no response
x remote server is not available

3, Ntptrace command

Ntptrace is used to track the time relationship between an NTP server and a time server.

[Root@c64-ntp-1 ~]# ntptrace-n 1.cn.pool.ntp.org
1.cn.pool.ntp.org:stratum 2, offset 0.007372, synch distance 0.097818

Part II: Error troubleshooting

When we synchronize the NTP server time with ntpdate IP on the client, we sometimes find information that reports no server suitable for synchronization found, resulting in the following 2 main causes of this information:

First, the Server dropped:strata too high

The no server suitable for synchronization found error occurred while the NTP client was running ntpdate IP.

[Root@c64-client ~]#/usr/sbin/ntpdate 192.168.1.111
3 Nov 06:20:45 ntpdate[48188]: No server suitable forsynchronization found

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.