How can I work out a system time offset between two different Linux servers?

We have two servers, Linux ServerA and ServerB. The system time on ServerA seems to be slightly behind ServerB, just a few hundredths of a second.

I am trying to diagnose a distributed transaction problem and have noticed slight inconsistencies between the times of the two servers, but I need to prove it somehow. I need something that will tell me that "ServerA is 0.002 seconds per ServerB". Maybe not as much as this, but you get the picture.

Is there any way to prove this? That is, is there a utility / script / command that I can use to tell me what the offset is?

+4
source share
3 answers

You can use ntpdate in query-only mode on both servers and compare the results (for example, how far it reports each server will be). Compare them with the same time, of course. And recommend to administrators that if the machines have not yet upgraded to ntpd , they should be. If synchronization is critical for what you are doing, you should have a local time server that is periodically synchronized with the outside world and with which your local servers are synchronized.

+5
source

you can use NTP to synchronize two servers, for example ntpdate

0
source

Using a utility called clockdiff , part of the iputils package. You need to run it with root, for example. sudo clockdiff <hostname> and its output is as follows:

 .. host=<hostname> rtt=562(280)ms/0ms delta=-3ms/-3ms Tue Dec 12 13:34:26 2017 
0
source

Source: https://habr.com/ru/post/1301832/


All Articles