1 views
実現する機能
NTP(Network Time Protocol)サーバーを構築して、サーバーのシステム時刻を日本標準時間に自動的に合わせます。パソコンの内蔵時計は月に数分狂うので、日本標準時間に自動同期することでサーバー時刻の正確性を確保しました。
NTPサーバー導入手順
(1)NTPサーバー設定
root@tu-ubuntu:~# aptitude -y install ntp ← ntpをインストール 以下の新規パッケージがインストールされます: libopts25{a} ntp 0 個のパッケージを更新、 2 個を新たにインストール、 0 個を削除予定、445 個が更新されていない。 * Starting NTP server ntpd [ OK ] [root@ufuso ~]# vi /etc/ntp.conf ← ntp.confを編集。 # Specify one or more NTP servers. # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for # more information. #server 0.ubuntu.pool.ntp.org ← #を付けて無効にする #server 1.ubuntu.pool.ntp.org ← #を付けて無効にする #server 2.ubuntu.pool.ntp.org ← #を付けて無効にする #server 3.ubuntu.pool.ntp.org ← #を付けて無効にする server ntp1.jst.mfeed.ad.jp ← 追記。日本標準時を提供しているNTPサーバー server ntp2.jst.mfeed.ad.jp ← 追記。日本標準時を提供しているNTPサーバー server ntp3.jst.mfeed.ad.jp ← 追記。日本標準時を提供しているNTPサーバー # Clients from this (example!) subnet have unlimited access, but only if # cryptographically authenticated. restrict 192.168.24.0 mask 255.255.255.0 nomodify notrap ← 追記。ネットワーク 内のPCからの同期を許可。192.168.24.0は例示 |
(2)NTPサーバー起動
root@tu-ubuntu:~# /etc/init.d/ntp restart ← NTPサーバーを起動 * Starting NTP server ntpd [ OK ] |
(3)NTPサーバー確認
root@tu-ubuntu:~# ntpq -p ← NTPサーバーへの時刻同期状態確認
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp1.jst.mfeed. 133.243.236.17 2 u 14 64 1 41.337 -68.492 0.000
ntp2.jst.mfeed. 172.16.176.60 2 u 13 64 1 38.315 -68.440 0.000
ntp3.jst.mfeed. 172.29.3.50 2 u 12 64 1 39.591 -65.440 0.000
juniperberry.ca 131.188.3.220 2 u 11 64 1 359.365 -112.46 0.000
root@tu-ubuntu:~# ntpq -p ← 10分後に再確認
remote refid st t when poll reach delay offset jitter
==============================================================================
*ntp1.jst.mfeed. 172.29.2.50 2 u 780 1024 377 40.274 0.758 0.926
+ntp2.jst.mfeed. 172.29.2.50 2 u 121 1024 377 37.931 -0.569 1.141
+ntp3.jst.mfeed. 133.243.236.19 2 u 885 1024 377 38.598 2.848 0.958
-golem.canonical 192.93.2.20 2 u 349 1024 377 284.523 1.873 2.123
※"^"はサーバ、"="はピア、"#"はローカル、"*"は同期対象として採用中、"+"は同
期対象候補、"-"はアルゴリズムにより同期対象から外れているもの
|
コメントを残す