https://access.redhat.com/solutions/3897921
Environment
・ Red Hat Enterprise Linux 7
・ Red Hat Enterprise Linux 6
・ chrony
Issue
- What does the following message mean? This can be observed in /var/log/messages file.
chronyd[23018]: System clock wrong by 51.202828 seconds, adjustment started
Resolution
This message means that it was starting to sync time due to over a 'logchange' option threthold at step or slew mode.
This default value is 1.0.
/etc/chrony.conf:
logchange 0.5
=> vi 또는 vim(gedit )등의 editor 로 /etc/chrony.conf 해당 파일에 logchange 0.5를 추가해주고 해당 chronyd 데몬을 재시작해주었더니 시간이 동기화되었다.
해당 아래의 명령어들을 활용해서 처리한 과정이다.
기존의 chronyd PID는 723이었으나 재시작 후 80063 으로 변경되면서 기존 processID(PID) 는 없어진다.
[root@centos7 ~]# chronyd -v
chronyd (chrony) version 3.4 (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
[root@centos7 ~]# ps -ef |grep chrony
chrony 723 1 0 Oct29 ? 00:00:01 /usr/sbin/chronyd
root 78189 67774 0 20:45 pts/9 00:00:00 grep --color=auto chrony
[root@centos7 ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-10-29 11:57:08 KST; 1 day 8h ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Process: 725 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
Process: 650 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 723 (chronyd)
CGroup: /system.slice/chronyd.service
└─723 /usr/sbin/chronyd
Oct 30 17:24:19 centos7.4 chronyd[723]: Can't synchronise: no majority
Oct 30 17:27:11 centos7.4 chronyd[723]: Selected source 211.233.84.186
Oct 30 17:27:11 centos7.4 chronyd[723]: System clock wrong by 72.594699 seco...d
Oct 30 17:31:51 centos7.4 chronyd[723]: Selected source 49.247.128.87
Oct 30 17:37:14 centos7.4 chronyd[723]: Selected source 13.209.84.50
Oct 30 20:21:36 centos7.4 chronyd[723]: Selected source 49.247.128.87
Oct 30 20:22:41 centos7.4 chronyd[723]: Source 13.209.84.50 replaced with 13...6
Oct 30 20:30:58 centos7.4 chronyd[723]: Selected source 211.233.84.186
Oct 30 20:30:58 centos7.4 chronyd[723]: System clock wrong by 898.197844 sec...d
Oct 30 20:35:16 centos7.4 chronyd[723]: Selected source 49.247.128.87
Hint: Some lines were ellipsized, use -l to show in full.
[root@centos7 ~]# ntpdate
-bash: ntpdate: command not found
[root@centos7 ~]# vim /etc/chrony.conf
[root@centos7 ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-10-29 11:57:08 KST; 1 day 9h ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Process: 725 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
Process: 650 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 723 (chronyd)
CGroup: /system.slice/chronyd.service
└─723 /usr/sbin/chronyd
Oct 30 17:24:19 centos7.4 chronyd[723]: Can't synchronise: no majority
Oct 30 17:27:11 centos7.4 chronyd[723]: Selected source 211.233.84.186
Oct 30 17:27:11 centos7.4 chronyd[723]: System clock wrong by 72.594699 seco...d
Oct 30 17:31:51 centos7.4 chronyd[723]: Selected source 49.247.128.87
Oct 30 17:37:14 centos7.4 chronyd[723]: Selected source 13.209.84.50
Oct 30 20:21:36 centos7.4 chronyd[723]: Selected source 49.247.128.87
Oct 30 20:22:41 centos7.4 chronyd[723]: Source 13.209.84.50 replaced with 13...6
Oct 30 20:30:58 centos7.4 chronyd[723]: Selected source 211.233.84.186
Oct 30 20:30:58 centos7.4 chronyd[723]: System clock wrong by 898.197844 sec...d
Oct 30 20:35:16 centos7.4 chronyd[723]: Selected source 49.247.128.87
Hint: Some lines were ellipsized, use -l to show in full.
[root@centos7 ~]# ps -ef |grep 723
chrony 723 1 0 Oct29 ? 00:00:01 /usr/sbin/chronyd
root 80018 67774 0 21:22 pts/9 00:00:00 grep --color=auto 723
[root@centos7 ~]# date
Sat Oct 30 21:22:34 KST 2021
[root@centos7 ~]# systemctl restart chronyd
[root@centos7 ~]# ps -ef |grep chronyd
chrony 80063 1 0 21:22 ? 00:00:00 /usr/sbin/chronyd
root 80074 67774 0 21:22 pts/9 00:00:00 grep --color=auto chronyd
[root@centos7 ~]# date
Sun Oct 31 23:08:17 KST 2021
[root@centos7 ~]# ^C
[root@centos7 ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-10-30 21:22:44 KST; 1 day 1h ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Process: 80065 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
Process: 80060 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 80063 (chronyd)
CGroup: /system.slice/chronyd.service
└─80063 /usr/sbin/chronyd
Oct 30 21:22:44 centos7.4 systemd[1]: Stopped NTP client/server.
Oct 30 21:22:44 centos7.4 systemd[1]: Starting NTP client/server...
Oct 30 21:22:44 centos7.4 chronyd[80063]: chronyd version 3.4 starting (+CMD...)
Oct 30 21:22:44 centos7.4 chronyd[80063]: Frequency -6.921 +/- 1.626 ppm rea...t
Oct 30 21:22:44 centos7.4 systemd[1]: Started NTP client/server.
Oct 30 21:22:50 centos7.4 chronyd[80063]: Selected source 49.247.128.87
Oct 30 21:22:50 centos7.4 chronyd[80063]: System clock wrong by 92721.135622...d
Oct 31 23:08:11 centos7.4 chronyd[80063]: System clock was stepped by 92721....s
Hint: Some lines were ellipsized, use -l to show in full.