Amazon Time Sync Service(Server:169.254.169.123)が設定され、同期が取れていることを確認する。
$ systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-02-25 10:40:28 JST; 1h 40min ago
Docs: man:chronyd(8)
man:chrony.conf(5)
Main PID: 2967 (chronyd)
CGroup: /system.slice/chronyd.service
mq2967 /usr/sbin/chronyd
Feb 25 10:40:27 ip-xx-xx-xx-xx.ap-northeast-1.compute.internal systemd[1]: ...
Feb 25 10:40:27 ip-xx-xx-xx-xx.ap-northeast-1.compute.internal chronyd[2967]: ...
Feb 25 10:40:27 ip-xx-xx-xx-xx.ap-northeast-1.compute.internal chronyd[2967]: ...
Feb 25 10:40:28 ip-xx-xx-xx-xx.ap-northeast-1.compute.internal systemd[1]: ...
Feb 25 10:40:45 ip-xx-xx-xx-xx.ap-northeast-1.compute.internal chronyd[2967]: S...
Feb 25 10:40:45 ip-xx-xx-xx-xx.ap-northeast-1.compute.internal chronyd[2967]: T...
Hint: Some lines were ellipsized, use -l to show in full.
$ chronyc tracking
Reference ID : A9FEA97B (169.254.169.123)
Stratum : 4
Ref time (UTC) : Mon Feb 25 03:21:03 2019
System time : 0.000034801 seconds fast of NTP time
Last offset : +0.000031882 seconds
RMS offset : 0.000065280 seconds
Frequency : 4.703 ppm fast
Residual freq : +0.016 ppm
Skew : 0.196 ppm
Root delay : 0.003376933 seconds
Root dispersion : 0.000516520 seconds
Update interval : 258.8 seconds
Timezone設定
下記サンプルは、TimezoneをJSTからUTCへ変更。(要件に合わせて変更)
$ date
Mon Feb 25 12:28:24 JST 2019
$ timedatectl status
Local time: Mon 2019-02-25 12:28:36 JST
Universal time: Mon 2019-02-25 03:28:36 UTC
RTC time: Mon 2019-02-25 03:28:35
Time zone: Asia/Tokyo (JST, +0900)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
$ sudo timedatectl set-timezone UTC
$ timedatectl status
Local time: Mon 2019-02-25 03:31:21 UTC
Universal time: Mon 2019-02-25 03:31:21 UTC
RTC time: Mon 2019-02-25 03:31:20
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
$ date
Mon Feb 25 03:31:25 UTC 2019
# systemctl status amazon-ssm-agent
● amazon-ssm-agent.service - amazon-ssm-agent
Loaded: loaded (/etc/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-02-25 01:40:42 UTC; 1h 57min ago
Main PID: 3615 (amazon-ssm-agen)
CGroup: /system.slice/amazon-ssm-agent.service
mq3615 /usr/bin/amazon-ssm-agent
Feb 25 03:10:57 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:11:05 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:15:57 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:20:57 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:20:57 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:25:46 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:25:57 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:30:57 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:30:59 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Feb 25 03:35:57 ip--xx-xx-xx.ap-northeast-1.compute.internal amazon-ssm-agent[3615]: ...
Hint: Some lines were ellipsized, use -l to show in full.