In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This "Linux system how to verify NTP synchronization" article knowledge points most people do not understand, so the editor summarized the following content, detailed, clear steps, with a certain reference value, I hope you can get something after reading this article, let's take a look at this "Linux system how to verify NTP synchronization" article.
NTP is a protocol used to synchronize computer time. It can enable the computer to synchronize its server or clock source, it can provide high-precision time correction, and encryption confirmation can be used to prevent malicious protocol attacks.
There are three commands in Linux that can be used to verify NTP synchronization.
Ntpq:ntpq is a standard NTP query program. Ntpstat: displays the synchronization status of the network world. Timedatectl: it controls the system time and date in the systemd system.
Method 1: how do I use the ntpq command to check the NTP status?
The ntpq utility is used to monitor the operation of the NTP daemon ntpd and determine performance.
The program can be run in interactive mode or controlled by command line parameters. It prints out a list of connected peers by sending multiple queries to the server. If NTP works properly, you will get output similar to the following.
# ntpq-p remote refid st t when poll reach delay offset jitter====*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432
Details:
-p: prints a list of peers known to the server and a summary of their status.
Method 2: how do I use the ntpstat command to check the NTP status?
Ntpstat reports the synchronization status of the NTP daemon (ntpd) running on the local computer. If the local system is found to be synchronized with the reference time source, ntpstat reports approximate time accuracy. The ntpstat command returns three status codes based on the NTP synchronization status. The details are as follows. 0: returns 0 if the clock is synchronized. 1: returns 1 if the clock is out of sync. 2: if the clock state is uncertain, 2 is returned, for example, if ntpd is unreachable.
# ntpstatsynchronised to NTP server (192.168.1.8) at stratum 3 time correct to within 508 ms polling server every 64 s method 3: how to use the timedatectl command to check NTP status?
The timedatectl command is used to query and change the system clock and its settings in systmed systems.
# timedatectl or # timedatectl status Local time: Thu 2019-05-30 05:01:05 CDT Universal time: Thu 2019-05-30 10:01:05 UTC RTC time: Thu 2019-05-30 10:01:05 Time zone: America/Chicago (CDT -0500) NTP enabled: yesNTP synchronized: yesRTC in local TZ: no DST active: yesLast DST change: DST began at Sun 2019-03-10 01:59:59 CST Sun 2019-03-10 03:00:00 CDTNext DST change: DST ends (the clock jumps one hour backwards) at Sun 2019-11-03 01:59:59 CDT Sun 2019-11-03 01:00:00 CST more tips
Chrony is an alternative to the NTP client. It can synchronize the system clock faster, has higher time accuracy, and is especially useful for systems that are not online all the time.
Chronyd is smaller, uses less memory, and wakes up CPU only when necessary, which can better save power. Even if the network is congested for a long time, it can run well.
You can use any of the following commands to check the Chrony status.
Check the Chrony trace status.
# chronyc trackingReference ID: C0A80105 (CentOS7.2daygeek.com) Stratum: 3Ref time (UTC): Thu Mar 28 05:57:27 2019System time: 0.000002545 seconds slow of NTP timeLast offset: + 0.001194361 secondsRMS offset: 0.001194361 secondsFrequency: 1.650 ppm fastResidual freq: + 184.101 ppmSkew: 2.962 ppmRoot delay: 0.107966967 secondsRoot dispersion: 1.060455322 secondsLeap status: Normal
Run the sources command to display information about the current time source.
# chronyc sources210 Number of sources = 1MS Name/IP address Stratum Poll Reach LastRx Last sample==== ^ * CentOS7.2daygeek.com 26 17 62 + 36us [+ 1230us] + /-1111ms above is the content of this article on "how to verify NTP synchronization in Linux system". I believe you all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about it, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.