Time is not synced in centos7.3
6,833
NTP takes some time to synchronize. It needs a couple data points, which takes a minute or two.
You can watch the state of peers with commands like chronyc sources
. Each server should have a packet received recently, the LastRx column.
timedatectl determines NTP status via the kernel time discipline. It calls adjtimex() and returns false on an error or if STA_UNSYNC. See systemd sources, time-util.c.
Related videos on Youtube
Author by
Sato
Updated on September 18, 2022Comments
-
Sato over 1 year
I have installed stock CentOS7.3, and install
chrony
yum install -y chrony systemctl start chronyd systemctl enable chronyd
If I start CentOS, the time is not synced:
$ timedatectl NTP enabled: yes NTP synchronized: no
chrony is running, though
$ 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 2017-06-02 12:19:35 JST; 17min ago Process: 631 ExecStartPost=/usr/libexec/chrony-helper update-daemon (code=exited, status=0/SUCCESS) Process: 608 ExecStart=/usr/sbin/chronyd $OPTIONS (code=exited, status=0/SUCCESS) Main PID: 620 (chronyd) Memory: 1.2M CGroup: /system.slice/chronyd.service └─620 /usr/sbin/chronyd
I have to do a manually
sudo systemctl restart chronyd
to fix the time syncing problem.Why is that.
-
Sato almost 7 yearsI waited 30mins, still no luck.
[root@localhost ~]# chronyc sources 210 Number of sources = 4 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^+ laika.paina.net 2 6 371 11 -231us[ -231us] +/- 35ms ^- jp.dan.me.uk 2 6 277 11 +11ms[ +11ms] +/- 185ms ^* chobi.paina.net 2 6 377 15 -287us[ -382us] +/- 21ms ^+ sjkBBML24.bb.kddi.ne.jp 5 6 377 12 +794us[ +794us] +/- 59ms