NTPd インストール
ヒント
NTPdとは
コンピュータの内部時計を、ネットワークを介して正しく時刻を合わせるデーモンです。
NTPdインストール
[root@centos ~]# yum -y install ntp
ntp.conf設定
[root@centos ~]# mv /etc/ntp.conf /etc/ntp.conf.org
[root@centos ~]# vi /etc/ntp.conf
↓下記を記入
driftfile /var/lib/ntp/drift
server ntp1.jst.mfeed.ad.jp iburst
server ntp2.jst.mfeed.ad.jp iburst
server ntp3.jst.mfeed.ad.jp iburst
NTPd起動
[root@centos ~]# ntpdate ntp1.jst.mfeed.ad.jp
20 Jan 21:29:11 ntpdate[303]: adjust time server 210.173.160.27 offset 0.313942 sec
[root@centos ~]# systemctl start ntpd
[root@centos ~]# systemctl enable ntpd
[root@centos ~]# systemctl is-enabled ntpd
enabled
同期確認
[root@centos ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+ntp1.jst.mfeed. 210.173.160.86 2 u 21 64 17 22.677 7.897 7.004
*ntp2.jst.mfeed. 210.173.176.251 2 u 25 64 17 22.446 12.529 9.473
+ntp3.jst.mfeed. 210.173.160.86 2 u 22 64 17 19.874 10.176 8.754
ヒント
「ntpq -p」コマンド実行後、左側の「*」は時刻同期中、「+」は接続可能な状態です。