NTP機能を実装して外部サーバと時刻同期を行う。
まずインストール
端末より
# yum install ntp
正常に完了したら
/etc/ntp.conf 設定ファイルを自分の環境に合わせて変更
# Hosts on local network are less restricted.
restrict 192.168.11.0 mask 255.255.255.0 nomodify notrap # コメントを外してLAN内のNTPサーバとして機能させる
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# ここに同期するNTPサーバを指定する
変更内容を保存する。
続いて動作させる。
端末より
#systemctl start ntpd.service # NTP機能動作開始
#systemctl enable ntpd.service # サービスに登録(起動時自動実行)
$ ntpq -p # 時刻の同期状態の確認
先頭に「*」マークが付いていれば同期中。
以上、NTP機能の実装でした。
まずインストール
端末より
# yum install ntp
正常に完了したら
/etc/ntp.conf 設定ファイルを自分の環境に合わせて変更
# Hosts on local network are less restricted.
restrict 192.168.11.0 mask 255.255.255.0 nomodify notrap # コメントを外してLAN内のNTPサーバとして機能させる
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
# ここに同期するNTPサーバを指定する
変更内容を保存する。
続いて動作させる。
端末より
#systemctl start ntpd.service # NTP機能動作開始
#systemctl enable ntpd.service # サービスに登録(起動時自動実行)
$ ntpq -p # 時刻の同期状態の確認
先頭に「*」マークが付いていれば同期中。
以上、NTP機能の実装でした。