In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the use of linux clockdiff command to detect the time difference between two linux hosts, I hope you will learn a lot after reading this article, let's discuss it together!
Timestamp data can be placed in both the header of ip message and the header of ICMP message. The clockdiff program uses timestamps to measure the system time difference between the destination host and the local host.
Syntax format: clockdiff [parameters] [ip address]
Common parameters:
-o use the IP timestamp option to measure the system time difference. The timestamp uses only 3-o1 to measure the system time difference using the IP timestamp option. Use 4 timestamps. If-o and-o1 are not set, then the ICMP timestamp is used to test the system time difference
Reference example
[root@linuxcool] # ping-T tsandaddr www.ustc.edu.cn-c 1 PING www.ustc.edu.cn (202.38.64.9) 56 (124) bytes of data. 64 bytes from 202.38.64.9: icmp_seq=1 ttl=62 time=0.823 ms TS: lixi-desktop.local (210.45.74.25) 12522473 absolute 210.45.74.1-251 local-gw.ustc.edu.cn (202.38.64.126) 248202.38.64.9-857514 Unrecorded hops: 3-www.ustc.edu.cn ping statistics-1 packets transmitted, 1 received, 0 packet loss Time 0ms rtt min/avg/max/mdev = 0.823 ms 0.823 ms
First of all, from the above, we can get the relationship between several ICMP timestamps when the RRT is small. The time difference between the local host and 202.38.64.9 is about-8575140248-2511487517. Test the system time of the above routes with-o (timestamp in the IP option) and without option (ICMP routing timestamp). The results obtained are:
[root@linuxcool] #. / clockdiff-o 202.38.64.9. Host=202.38.64.9 rtt=1 (0) ms/1ms delta=-857517ms/-857517ms Wed Dec 17 11:28:30 2008 [root@linuxcool] #. / clockdiff 202.38.64.9 host=202.38.64.9 rtt=750 17 11:28:35 2008 ms/0ms delta=-857517ms/-857517ms Wed Dec
Both methods are more accurate:
[root@linuxcool ~] #. / clockdiff gigagate1.Princeton.EDU... Host=gigagate1.Princeton.EDU rtt=307 (21) ms/271ms delta=-5ms/-5ms Wed Dec 17 11:50:16 2008
The above is the system time difference between the destination host and the local host with a large RTT. When using clockdiff, however, you need a bit of luck, because many routes ignore ICMP or IP timestamps.
After reading this article, I believe you have a certain understanding of the time difference between using linux's clockdiff command to detect two linux hosts. If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!
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.