NTPで時刻合わせ
動作確認システム CentOS 8
CentOS 8でのNTPクライアントは、CentOS 7までのntpdに代わり、chronyが使われる。
以下のコマンドでchronyをインストールする。
dnf install chrony
設定ファイルを編集する
vi /etc/chrony.conf
#pool 2.centos.pool.ntp.org iburst
pool ntp1.jst.mfeed.ad.jp
chronydを自動起動する
systemctl enable --now chronyd
NTPStatを使うと、時刻同期の状況が分かりやすく確認できる。
dnf install ntpstat
時刻同期の状況を確認するには、ntpstatコマンドを使う
ntpstat
synchronised to NTP server (xxx.xxx.xxx.xxx) at stratum 3
time correct to within 64783 ms
polling server every 64 s