time sync problem

General support questions
Post Reply
stum74
Posts: 6
Joined: 2019/04/18 13:23:51

time sync problem

Post by stum74 » 2020/09/09 09:35:45

Hello.
First encountered the problem of time synchronization on the server. I have several Centos7 servers at work and only one has a problem.
Installed on the server:
Centos7, asterisk 16, apache, iptables, chronyd default config.
I noticed an interesting thing. Yesterday I turned off the asterisk service for the night. All night long, there were no problems with time. In the morning, the time was synchronized. I turned on the asterisk and after about an hour, the time was out of sync.

Code: Select all

Sep  8 17:47:19 astr chronyd[2572]: System clock was stepped by -392.765086 seconds
Sep  8 18:00:30 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  8 18:00:30 astr systemd: Starting Time & Date Service...
Sep  8 18:00:30 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  8 18:00:30 astr systemd: Started Time & Date Service.
Sep  8 18:01:17 astr systemd: Stopping LSB: Asterisk PBX...
Sep  8 18:01:17 astr asterisk: Stopping safe_asterisk: [  OK  ]
Sep  8 18:01:17 astr asterisk: Shutting down asterisk: [  OK  ]
Sep  8 18:01:17 astr systemd: Stopped LSB: Asterisk PBX.
Sep  9 00:00:01 astr systemd: Starting update of the root trust anchor for DNSSEC validation in unbound...
Sep  9 00:00:02 astr systemd: Started update of the root trust anchor for DNSSEC validation in unbound.
Sep  9 02:32:26 astr rsyslogd: imjournal: journal reloaded... [v8.24.0-52.el7_8.2 try http://www.rsyslog.com/e/0 ]
Sep  9 08:23:14 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  9 08:23:14 astr systemd: Starting Time & Date Service...
Sep  9 08:23:14 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  9 08:23:14 astr systemd: Started Time & Date Service.
Sep  9 08:29:49 astr systemd: Starting LSB: Asterisk PBX...
Sep  9 08:29:49 astr asterisk: Starting asterisk:
Sep  9 08:29:49 astr systemd: Can't open PID file /var/run/asterisk/asterisk.pid (yet?) after start: No such file or directory
Sep  9 08:29:49 astr systemd: asterisk.service: Supervising process 4826 which is not our child. We'll most likely not notice when it exits.
Sep  9 08:29:49 astr systemd: Started LSB: Asterisk PBX.
Sep  9 09:22:28 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  9 09:22:28 astr systemd: Starting Time & Date Service...
Sep  9 09:22:28 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  9 09:22:28 astr systemd: Started Time & Date Service.
Sep  9 09:35:10 astr systemd: Time has been changed
Sep  9 09:37:55 astr chronyd[2572]: Forward time jump detected!
Sep  9 09:37:55 astr chronyd[2572]: Can't synchronise: no selectable sources
Sep  9 09:41:08 astr chronyd[2572]: Selected source 10.50.0.11
Sep  9 09:41:08 astr chronyd[2572]: System clock wrong by -574.385889 seconds, adjustment started
Sep  9 09:45:27 astr chronyd[2572]: Selected source 10.50.0.10
Sep  9 10:07:48 astr chronyd[2572]: chronyd exiting
Sep  9 10:07:48 astr systemd: Stopping NTP client/server...
Sep  9 10:07:48 astr systemd: Stopped NTP client/server.
Sep  9 10:07:48 astr yum[5403]: Erased: chrony-3.4-1.el7.x86_64
Sep  9 10:07:48 astr systemd: Reloading.
Sep  9 10:07:48 astr systemd: asterisk.service: Supervising process 4826 which is not our child. We'll most likely not notice when it exits.
Sep  9 10:09:29 astr systemd: Reloading.
Sep  9 10:09:29 astr systemd: asterisk.service: Supervising process 4826 which is not our child. We'll most likely not notice when it exits.
Sep  9 10:09:29 astr systemd: Reloading.
Sep  9 10:09:29 astr systemd: asterisk.service: Supervising process 4826 which is not our child. We'll most likely not notice when it exits.
Sep  9 10:09:29 astr yum[5428]: Installed: chrony-3.4-1.el7.x86_64
Sep  9 10:09:53 astr systemd: Starting NTP client/server...
Sep  9 10:09:53 astr chronyd[5550]: Could not open IPv6 command socket : Address family not supported by protocol
Sep  9 10:09:53 astr chronyd[5550]: Initial frequency 10.468 ppm
Sep  9 10:09:53 astr systemd: Started NTP client/server.
Sep  9 10:02:50 astr chronyd[5550]: Selected source 85.21.78.23
Sep  9 10:02:50 astr chronyd[5550]: System clock wrong by -428.928932 seconds, adjustment started
Sep  9 10:02:50 astr systemd: Time has been changed
Sep  9 10:02:50 astr chronyd[5550]: System clock was stepped by -428.928932 seconds
Sep  9 10:02:57 astr systemd: Reloading.
Sep  9 10:02:57 astr systemd: asterisk.service: Supervising process 4826 which is not our child. We'll most likely not notice when it exits.
Sep  9 10:06:05 astr chronyd[5550]: Selected source 78.36.18.184
Sep  9 10:09:36 astr chronyd[5550]: chronyd exiting
Sep  9 10:09:36 astr systemd: Stopping NTP client/server...
Sep  9 10:09:36 astr systemd: Stopped NTP client/server.
Sep  9 10:09:36 astr systemd: Starting NTP client/server...
Sep  9 10:09:36 astr chronyd[5695]: Frequency 12.118 +/- 0.603 ppm read from /var/lib/chrony/drift
Sep  9 10:09:36 astr systemd: Started NTP client/server.
Sep  9 10:09:41 astr chronyd[5695]: Selected source 192.36.143.130
Sep  9 10:10:32 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  9 10:10:32 astr systemd: Starting Time & Date Service...
Sep  9 10:10:32 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  9 10:10:32 astr systemd: Started Time & Date Service.
Sep  9 10:27:42 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  9 10:27:42 astr systemd: Starting Time & Date Service...
Sep  9 10:27:42 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  9 10:27:42 astr systemd: Started Time & Date Service.


# cat /var/log/messages
Sep  9 10:45:01 astr rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-52.el7_8.2" x-pid="918" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Sep  9 11:09:19 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  9 11:09:19 astr systemd: Starting Time & Date Service...
Sep  9 11:09:19 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  9 11:09:19 astr systemd: Started Time & Date Service.
Sep  9 11:23:56 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  9 11:23:56 astr systemd: Starting Time & Date Service...
Sep  9 11:23:56 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  9 11:23:56 astr systemd: Started Time & Date Service.
Sep  9 11:39:43 astr systemd: Stopping The Apache HTTP Server...
Sep  9 11:39:44 astr systemd: Stopped The Apache HTTP Server.
Sep  9 11:39:44 astr systemd: Starting The Apache HTTP Server...
Sep  9 11:39:44 astr systemd: Started The Apache HTTP Server.
Sep  9 11:55:15 astr systemd: Stopping The Apache HTTP Server...
Sep  9 11:55:16 astr systemd: Stopped The Apache HTTP Server.
Sep  9 11:55:16 astr systemd: Starting The Apache HTTP Server...
Sep  9 11:55:17 astr systemd: Started The Apache HTTP Server.
Sep  9 11:57:51 astr systemd: Stopping The Apache HTTP Server...
Sep  9 11:57:52 astr systemd: Stopped The Apache HTTP Server.
Sep  9 11:57:52 astr systemd: Starting The Apache HTTP Server...
Sep  9 11:57:52 astr systemd: Started The Apache HTTP Server.
Sep  9 12:12:13 astr systemd: Time has been changed
Sep  9 12:12:27 astr chronyd[5695]: Forward time jump detected!
Sep  9 12:12:27 astr chronyd[5695]: Can't synchronise: no selectable sources
Sep  9 12:12:39 astr dbus[656]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service'
Sep  9 12:12:39 astr systemd: Starting Time & Date Service...
Sep  9 12:12:39 astr dbus[656]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep  9 12:12:39 astr systemd: Started Time & Date Service.
[root@astr ~]#

# timedatectl
      Local time: Wed 2020-09-09 12:15:09 MSK
  Universal time: Wed 2020-09-09 09:15:09 UTC
        RTC time: Wed 2020-09-09 09:05:35
       Time zone: Europe/Moscow (MSK, +0300)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
[root@astr ~]#
[root@astr ~]# chronyc source
Unrecognized command
[root@astr ~]# chronyc sources
210 Number of sources = 4
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^- tms04.deltatelesystems.ru     2   6   377    12   +825us[ +825us] +/-   81ms
^- time.ooonet.ru                2   6   377    12  +4151us[+4151us] +/-   60ms
^- ns1.ooonet.ru                 2   6   377    12  +7333us[+7333us] +/-   75ms
^* time100.stupi.se              1   6   377    13   +431us[ +911us] +/-   14ms
[root@astr ~]#
[root@astr ~]# chronyc sourcestats
210 Number of sources = 4
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
tms04.deltatelesystems.ru   5   3   272     +4.235      8.610   +929us    83us
time.ooonet.ru              5   3   271     -1.509    117.684  +4640us  2252us
ns1.ooonet.ru               5   4   271    -23.324    250.270  +3445us  3215us
time100.stupi.se            5   3   271     +1.493     68.059    +44us   830us


[root@astr ~]# systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-09-09 10:09:36 MSK; 2h 18min ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
  Process: 5697 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
  Process: 5693 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 5695 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─5695 /usr/sbin/chronyd -4

Sep 09 10:09:36 astr.local systemd[1]: Starting NTP client/server...
Sep 09 10:09:36 astr.local chronyd[5695]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
Sep 09 10:09:36 astr.local chronyd[5695]: Frequency 12.118 +/- 0.603 ppm read from /var/lib/chrony/drift
Sep 09 10:09:36 astr.local systemd[1]: Started NTP client/server.
Sep 09 10:09:41 astr.local chronyd[5695]: Selected source 192.36.143.130
Sep 09 12:12:27 astr.local chronyd[5695]: Forward time jump detected!
Sep 09 12:12:27 astr.local chronyd[5695]: Can't synchronise: no selectable sources
Sep 09 12:15:41 astr.local chronyd[5695]: Selected source 192.36.143.130
Sep 09 12:15:41 astr.local chronyd[5695]: System clock wrong by -574.417862 seconds, adjustment started
[root@astr ~]#

If i restarting chronyd: timedatectl is OK

User avatar
TrevorH
Forum Moderator
Posts: 29491
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: time sync problem

Post by TrevorH » 2020/09/09 14:21:39

What sort of machine is this? Physical or virtual? Manufacturer & model?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

stum74
Posts: 6
Joined: 2019/04/18 13:23:51

Re: time sync problem

Post by stum74 » 2020/09/09 14:28:27

Thanks for your reply!

It's vmware ESXi 5.0

Code: Select all

[root@astr ~]# yum info  open-vm-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.reconn.ru
 * epel: mirror.datacenter.by
 * extras: centos-mirror.rbc.ru
 * remi-safe: mirror.reconn.ru
 * updates: mirror.reconn.ru
Installed Packages
Name        : open-vm-tools
Arch        : x86_64
Version     : 10.3.10
Release     : 2.el7_8.1
Size        : 2.1 M
Repo        : installed
From repo   : updates
Summary     : Open Virtual Machine Tools for virtual machines hosted on VMware
URL         : https://github.com/vmware/open-vm-tools
License     : GPLv2
Description : The open-vm-tools project is an open source implementation of VMware Tools. It
            : is a suite of open source virtualization utilities and drivers to improve the
            : functionality, user experience and administration of VMware virtual machines.
            : This package contains only the core user-space programs and libraries of
            : open-vm-tools.

User avatar
TrevorH
Forum Moderator
Posts: 29491
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: time sync problem

Post by TrevorH » 2020/09/09 15:55:14

If you have the vmware tools or open-vm-tools installed on the VM and it is configured to do so in the VM settings on the host then the host will sync the time to the guest.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - General Support”