1 views
実現する機能
NTP(Network Time Protocol)サーバーを構築して、サーバーのシステム時刻を日本標準時間に自動的に合わせます。パソコンの内蔵時計は月に数分狂うので、日本標準時間に自動同期することでサーバー時刻の正確性を確保しました。
NTPサーバー導入手順
(1)NTPサーバー設定
[root@ufuso ~]# vi /etc/ntp.conf ← ntp.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 ← #を付けて無効にする
#server 1.centos.pool.ntp.org ← #を付けて無効にする
#server 2.centos.pool.ntp.org ← #を付けて無効にする
server -4 ntp.nict.jp ← 追記。日本標準時を提供しているNTPサーバー(stratum 1)
server -4 ntp.jst.mfeed.ad.jp ← 追記。上記サーバーと直接同期しているNTPサーバ
ー(stratum 2)
※ntp.confファイルが無ければyum -y install ntpと入力してインストールから
始めること
|
(2)NTPサーバー起動
[root@ufuso ~]# ntpdate ntp.nict.jp ← 手動で同期を図る 31 Aug 11:36:46 ntpdate[10176]: step time server 133.243.238.244 offset 1.213921 sec [root@ufuso ~]# /etc/rc.d/init.d/ntpd start ← NTPサーバーを起動させる ntpd を起動中: [ OK ] [root@ufuso ~]# chkconfig ntpd on ← 自動起動をONにする |
(3)NTPサーバー確認
[root@ufuso ~]# ntpq -p ← NTPサーバーへの時刻同期状態確認 remote refid st t when poll reach delay offset jitter ============================================================================== ntp-a3.nict.go. .NICT. 1 u 27 64 1 36.572 0.672 0.002 ntp2.jst.mfeed. 210.173.176.251 2 u 26 64 1 37.862 2.025 0.002 [root@ ~]# ntpq -p ← 10分程度経ってから再度NTPサーバーへの時刻同期状態確認。 NTPサーバー名の前に*または+が表示されれば時刻同期完了の状態 remote refid st t when poll reach delay offset jitter ============================================================================== *ntp-a3.nict.go. .NICT. 1 u 688 1024 377 37.489 -7.202 0.460 +ntp2.jst.mfeed. 210.173.160.56 2 u 980 1024 377 37.624 -5.338 0.256 |
コメントを残す