1 views
実現する機能
NTP(Network Time Protocol)サーバーを構築して、サーバーのシステム時刻を日本標準時間に自動的に合わせます。パソコンの内蔵時計は月に数分狂うので、日本標準時間に自動同期することでサーバー時刻の正確性を確保しました。
NTPサーバー導入手順
(1)NTPサーバー設定
[root@ufuso ~]# vi /etc/chrony.conf ← chrony.confを編集。
# 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 ← #を付けて無効にする
server ntp1.jst.mfeed.ad.jp ← 追記。上記サーバーと直接同期しているNTPサーバ
ー(stratum 2)
server ntp2.jst.mfeed.ad.jp ← 追記。上記サーバーと直接同期しているNTPサーバ
ー(stratum 2)
server ntp3.jst.mfeed.ad.jp ← 追記。上記サーバーと直接同期しているNTPサーバ
ー(stratum 2)
# Allow NTP client access from local network.
#allow 192.168/16
allow 192.168.24.0/24 ← 追記。ネットワーク内のPCからの同期を許可。
192.168.24.0/24は例示
※chrony.confファイルが無ければyum -y install chronyと入力してインストール
から始めること
|
(2)NTPサーバー起動
[root@ufuso ~]# ntpdate ntp.nict.jp ← 手動で同期を図る 26 Aug 01:48:12 ntpdate[14173]: adjust time server 2001:df0:232:eea0::fff3 offset 0.000992 sec [root@ufuso ~]# systemctl start chronyd ← NTPサーバーを起動させる [root@ufuso ~]# systemctl enable chronyd ← 自動起動をONにする |
(3)NTPサーバー確認
[root@ufuso ~]# chronyc sources ← NTPサーバーへの時刻同期状態確認
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* sv01.azsx.net 2 6 327 6 +671us[ +811us] +/- 18ms
^- 45.32.43.46.ss.cpmsxe.net 2 7 377 8 -3690us[-3550us] +/- 136ms
^- time.platformnine.com 3 6 367 3 -32us[ -32us] +/- 110ms
^+ jp.linode.oxoox.me 2 7 277 70 -520us[ -392us] +/- 50ms
※"^"はサーバ、"="はピア、"#"はローカル、"*"は同期対象として採用中、"+"は同期
対象候補、"-"はアルゴリズムにより同期対象から外れているもの
|
コメントを残す