NTP issue

Issues related to applications and software problems
Post Reply
v.m.varga
Posts: 2
Joined: 2019/04/12 09:15:43

NTP issue

Post by v.m.varga » 2019/04/12 09:35:17

Hello gentlemen,

I have the trouble with ntp syncronization. There is two servers, ntp.conf the same, but first syncronized succesfully, second is not.
ntp.conf:
For more information about this file, see the man pages
ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift

Permit time synchronization with our time source, but do not
permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery

Permit all access over the loopback interface. This could
be tightened as well, but to do so would effect some of
the administrative functions.
restrict 127.0.0.1 restrict -6 ::1

Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

Use public servers from the pool.ntp.org project.
Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.rhel.pool.ntp.org #server 1.rhel.pool.ntp.org #server 2.rhel.pool.ntp.org

server 10.144.18.133
server 10.191.0.65
server 10.144.18.165
server 10.144.6.1

#broadcast 192.168.1.255 autokey # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 autokey # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 autokey # manycast client

Undisciplined Local Clock. This is a fake driver intended for backup
and when no outside source of synchronized time is available.
#server 127.127.1.0 # local clock #fudge 127.127.1.0 stratum 10

Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

logfile /var/log/ntpstats/ntp1.log

Key file containing the keys and key identifiers used when operating
with symmetric key cryptography.
keys /etc/ntp/keys

Specify the key identifiers which are trusted.
#trustedkey 4 8 42

Specify the key identifier to use with the ntpdc utility.
#requestkey 8

Specify the key identifier to use with the ntpq utility.
#controlkey 8

Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
10.144.18.133 0.0.0.0 1 u 48 64 1 1.145 10904.3 0.000
10.191.0.65 10.144.18.133 2 u 47 64 1 0.534 11015.3 0.000
10.144.18.165 0.0.0.0 1 u 46 64 1 1.623 11126.3 0.000
10.144.6.1 10.191.0.65 3 u 45 64 1 0.500 11237.5 0.000

Ntp logs:
cat /var/log/ntpstats/ntp1.log
11 Apr 21:21:25 ntpd[3901]: ntpd exiting on signal 15
11 Apr 21:22:21 ntpd[3928]: ntpd exiting on signal 15

System logs more:
Apr 11 22:32:42 ntpd[3956]: ntpd 4.2.4p8@1.1612-o Wed Aug 25 13:54:50 UTC 2010 (1)
Apr 11 22:32:42 ntpd[3958]: precision = 0.059 usec
Apr 11 22:32:42 ntpd[3958]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Apr 11 22:32:42 ntpd[3958]: Listening on interface #1 wildcard, ::#123 Disabled
Apr 11 22:32:42 ntpd[3958]: Listening on interface #2 eth0, fe80::20c:29ff:fe28:cca4#123 Enabled
Apr 11 22:32:42 ntpd[3958]: Listening on interface #3 lo, ::1#123 Enabled
Apr 11 22:32:42 ntpd[3958]: Listening on interface #4 eth1, fe80::20c:29ff:fe28:ccae#123 Enabled
Apr 11 22:32:42 ntpd[3958]: Listening on interface #5 lo, 127.0.0.1#123 Enabled
Apr 11 22:32:42 ntpd[3958]: Listening on interface #6 eth0, 10.144.6.33#123 Enabled
Apr 11 22:32:42 ntpd[3958]: Listening on interface #7 eth1, 217.118.72.58#123 Enabled
Apr 11 22:32:42 ntpd[3958]: Listening on routing socket on fd #24 for interface updates
Apr 11 22:32:42 ntpd[3958]: kernel time sync status 2040
Apr 11 22:32:42 ntpd[3958]: frequency initialized 123.949 PPM from /var/lib/ntp/drift

Also, i found interesting moment, hwclock --systohc after manualy syncronizing with, for example, 10.144.18.133 this server works fine but after ~4 minutes sys time late about 20 sec. Аnd lags behind more over time. Doesn't matter ntpd enable or not.

Thank's!

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: NTP issue

Post by TrevorH » 2019/04/12 10:13:37

Apr 11 22:32:42 ntpd[3956]: ntpd 4.2.4p8@1.1612-o Wed Aug 25 13:54:50 UTC 2010 (1)
The current ntp package on CentOS 6 is ntp-4.2.6p5-15.el6.centos.x86_64 and was built on Wed 19 Dec 2018 08:22:40 PM UTC. We stopped shipping an ntp 4.2.4p8 version in CentOS 6.5 which means that your system currently dates from pre-6.5 and that came out in Dec 2013 so you are now more than 5 years behind the current version. If that's also reflected in the rest of your system then it is extremely dangerous and needs patching ASAP.

You may well find that your current problem has been fixed in the last 6 years.

You need to run yum update more often than every 5 years. Try once a week and maybe the system will still belong to you at the end of its life!
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

v.m.varga
Posts: 2
Joined: 2019/04/12 09:15:43

Re: NTP issue

Post by v.m.varga » 2019/04/12 10:36:41

Anoter server use the same ntpd version and there ntpd works correctly.
# cat /var/log/messages | grep ntpd
Apr 10 02:34:48 ntpd[1419]: ntpd exiting on signal 15
Apr 10 02:34:48 ntpd[4984]: ntpd 4.2.4p8@1.1612-o Wed Aug 25 13:54:50 UTC 2010 (1)
Apr 10 02:34:48 ntpd[4985]: precision = 0.065 usec
Apr 10 02:34:48 ntpd[4985]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Apr 10 02:34:48 ntpd[4985]: Listening on interface #1 wildcard, ::#123 Disabled
Apr 10 02:34:48 ntpd[4985]: Listening on interface #2 lo, ::1#123 Enabled
Apr 10 02:34:48 ntpd[4985]: Listening on interface #3 eth0, fe80::20c:29ff:fe3f:6566#123 Enabled
Apr 10 02:34:48 ntpd[4985]: Listening on interface #4 eth1, fe80::20c:29ff:fe3f:6570#123 Enabled
Apr 10 02:34:48 ntpd[4985]: Listening on interface #5 lo, 127.0.0.1#123 Enabled
Apr 10 02:34:48 ntpd[4985]: Listening on interface #6 eth0, 10.144.6.32#123 Enabled
Apr 10 02:34:48 ntpd[4985]: Listening on interface #7 eth1, 217.118.72.57#123 Enabled
Apr 10 02:34:48 ntpd[4985]: Listening on routing socket on fd #24 for interface updates
Apr 10 02:34:48 ntpd[4985]: kernel time sync status 2040
Apr 10 02:34:48 ntpd[4985]: frequency initialized 124.223 PPM from /var/lib/ntp/drift
Apr 10 02:38:03 ntpd[4985]: synchronized to 10.191.0.65, stratum 2
Apr 10 02:38:03 ntpd[4985]: kernel time sync status change 2001
Apr 10 02:38:09 ntpd[4985]: synchronized to 10.145.111.135, stratum 1
Apr 10 02:49:53 ntpd[4985]: synchronized to 10.144.18.133, stratum 1
Apr 10 02:57:26 ntpd[4985]: synchronized to 10.144.18.165, stratum 1
Apr 10 03:14:42 ntpd[4985]: synchronized to 10.144.18.133, stratum 1
Apr 10 03:29:33 ntpd[4985]: synchronized to 10.145.111.135, stratum 1
Apr 10 04:08:01 ntpd[4985]: synchronized to 10.144.18.133, stratum 1

Both servers are "inherited" so they are my headache now.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: NTP issue

Post by TrevorH » 2019/04/12 11:20:59

Unfortunately 6.4 is utterly unsupported. There's a good chance that whatever bug you're seeing, if it is a bug, is fixed in the latest version. Update.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply