[root@rhel75 ~]# date
2019年 2月 21日 木曜日 00:44:25 JST
↓別マシン ↑なかなか直らない
[root@ora12ee01 /]# date
2019年 2月 21日 木曜日 00:44:53 JST
●状況確認
[root@rhel75 ~]# chronyc tracking
Reference ID : 202.181.103.212 (sv1.localdomain1.com)
Stratum : 3
Ref time (UTC) : Thu Feb 21 15:20:33 2019 ←正しい時刻
System time : 297.692199707 seconds slow of NTP time ←サーバの時刻のずれ
Last offset : +0.003249092 seconds
RMS offset : 0.003386053 seconds
Frequency : 0.261 ppm fast
Residual freq : +6.568 ppm
Skew : 10.036 ppm
Root delay : 0.016244 seconds
Root dispersion : 0.021315 seconds
Update interval : 0.4 seconds
Leap status : Normal
●HWCLOCKの監視
[root@rhel75 ~]# watch -n 10 hwclock
Every 10.0s: hwclock Fri Feb 22 00:59:46 2019
2019年02月22日 01時02分55秒 -0.080759 秒
↑デフォルトで11分ごとにHWCLOCKが同期されるようだが、されないぞ!?
●NTPサーバ同士のずれ?意味ある?
[root@rhel75 network-scripts]# chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- sv1.localdomain1.com 2 9 177 125 -973us[ -973us] +/- 45ms
^- ntp.paina.net 2 8 373 325 -2008us[-2008us] +/- 35ms
^- tama.paina.net 2 8 377 261 -3104us[-3104us] +/- 54ms
^* ntp-a3.nict.go.jp 1 9 37 452 -127us[ -160us] +/- 5078us
●こんなコマンドもあった
[root@rhel75 ~]# timedatectl
Local time: 日 2019-02-24 22:30:06 JST
Universal time: 日 2019-02-24 13:30:06 UTC
RTC time: 日 2019-02-24 13:30:05
Time zone: Asia/Tokyo (JST, +0900)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
#leapsecmode slew ←うるう秒対応?いろいろややこしいので設定する場合はナレッジ参照
[root@rhel75 network-scripts]# date
2019年 2月 21日 木曜日 00:41:30 JST
[root@rhel75 network-scripts]# date --set="00:41"
2019年 2月 21日 木曜日 00:41:00 JST
[root@rhel75 network-scripts]# systemctl restart chronyd
↑slewモードにした
[root@rhel75 network-scripts]# grep leap /etc/chrony.conf
#makestep 10 3
makestep 10 3
●デフォルトのstepモード
[root@rhel75 network-scripts]# date
2019年 2月 21日 木曜日 00:29:44 JST
[root@rhel75 network-scripts]# date --set="00:20"
2019年 2月 21日 木曜日 00:20:00 JST
[root@rhel75 network-scripts]# systemctl restart chronyd
↓すぐに時刻が修正される
[root@rhel75 network-scripts]# date
2019年 2月 21日 木曜日 00:32:04 JST
[root@rhel75 network-scripts]# grep makestep /etc/chrony.conf
↑10秒以上の誤差が3回続いた場合、stepモード
10秒以下ならslewモードで修正する意味
●slewモードに変更