DynagenでCCIEを目指す
NTP Server インストール手順
最終更新:
it_certification
-
view
1. 履歴
- 2010/08/XX 初稿
2. はじめに
- NTPサーバのインストール手順を記述します。
- 前提条件
- タイムゾーンが東京に設定されているものとします
3. NTPのインストール
3.1. NTP有無の確認
NTPがインストール済みかどうかを確認します。NTPがインストール済みの場合は、手順「3. NTPのインストール」を省略します。
[root@localhost ~]# rpm -qa | grep ntp [root@localhost ~]#
3.2. NTPのインストール
[root@localhost ~]# yum install ntp
3.3. NTP インストールの確認
NTPがインストールされた事を確認します。
[root@localhost ~]# rpm -qa | grep ntp ntpdate-4.2.4p7-2.fc10.i386 ntp-4.2.4p7-2.fc10.i386 [root@localhost ~]#
4. 上位サーバとの同期
4.1. 同期設定
NTPサーバが上位のNTPサーバと同期するよう設定します。/etc/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.fedora.pool.ntp.org server 1.fedora.pool.ntp.org server 2.fedora.pool.ntp.org
- 変更後
# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). #server 0.fedora.pool.ntp.org #server 1.fedora.pool.ntp.org #server 2.fedora.pool.ntp.org server ntp.nict.jp server ntp.nc.u-tokyo.ac.jp
NTPサーバは下記URLなどを参考に選んで下さい。
http://www.asahi-net.or.jp/~mu6k-ski/ntp.html
4.2. NTPの起動
NTPサービスを起動させます。
[root@localhost ~]# /etc/init.d/ntpd restart Shutting down ntpd: [FAILED] Starting ntpd: [ OK ] [root@localhost ~]#
次回OS起動時にNTPサービスが起動するよう、chkconfigも忘れずに設定しましょう。
[root@localhost ~]# chkconfig --level 345 ntpd on [root@localhost ~]#
4.3. 時刻同期の確認
上位のNTPサーバと同期されている事を確認します。「*」が現在時刻同期しているサーバです。
「*」のマークが記載されるようになるまでしばらく待って下さい。
「*」のマークが記載されるようになるまでしばらく待って下さい。
[root@localhost ~]# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== +ntp-b3.nict.go. .NICT. 1 u 44 128 377 159.379 -13.188 55.310 *ntp.nc.u-tokyo. .GPS. 1 u 123 128 377 130.044 -38.952 28.703 [root@localhost ~]#
本手順書通りにOSインストールを実施した場合は、以下のようなエラーメッセージが表示されます。これは、localhostの名前解決ができない場合も表示されます。
[root@localhost ~]# ntpq -p Name or service not known [root@localhost ~]#
/etc/hostsに以下1行を加筆する事で、この問題を解決する事をできます。
127.0.0.1 localhost
(メモ)ristric ignoreの指定は必要