AWS Ubuntu NTP設定方法¶
サービスの開始
sudo /etc/init.d/chrony start [ ok ] Starting chrony (via systemctl): chrony.service.
時刻を同期させていることの確認
chronyc sources -v Amazon Time Sync ServiceのIPアドレス:169.254.169.123を使用していることを確認 210 Number of sources = 1 .-- Source mode '^' = server, '=' = peer, '#' = local clock. / .- Source state '*' = current synced, '+' = combined , '-' = not combined, | / '?' = unreachable, 'x' = time may be in error, '~' = time too variable. || .- xxxx [ yyyy ] +/- zzzz || Reachability register (octal) -. | xxxx = adjusted offset, || Log2(Polling interval) --. | | yyyy = measured offset, || \ | | zzzz = estimated error. || | | \ MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 169.254.169.123 3 6 17 27 +1967ns[+5612ns] +/- 364us
時刻同期のメトリクスを確認
chronyc tracking (例) Reference ID : A9FEA97B (169.254.169.123) Stratum : 4 Ref time (UTC) : Thu Aug 20 04:33:27 2020 System time : 0.000000004 seconds slow of NTP time Last offset : +0.000003645 seconds RMS offset : 0.000003645 seconds Frequency : 0.704 ppm fast Residual freq : -0.549 ppm Skew : 0.020 ppm Root delay : 0.000232039 seconds Root dispersion : 0.000348835 seconds Update interval : 2.0 seconds Leap status : Normal
サービスの自動起動を有効化する
systemctl enable chrony Synchronizing state of chrony.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable chrony Created symlink /etc/systemd/system/chronyd.service → /lib/systemd/system/chrony.service. Created symlink /etc/systemd/system/multi-user.target.wants/chrony.service → /lib/systemd/system/chrony.service.
サービス自動起動の設定を確認する
systemctl is-enabled chrony enabled