トップページ > インフォメーション

自宅サーバ構築MY HOME SERVER

サーバ時刻設定(NTP)

- サーバ時刻設定(NTP) -
サーバーにntpクライアントをインストールしておけば、ntpサーバーに接続して正確な時間を取得することができます。 自動で正確な時刻を取得するように設定・保存します。

[root@hoge123~]# yum -y install ntp
[root@hoge123~]# vi /etc/ntp.conf

19行目付近に追記します。
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
先頭に#を付けて、コメントアウトします。
#server 0.rhel.pool.ntp.org
#server 1.rhel.pool.ntp.org
#server 2.rhel.pool.ntp.org
下記内容を追記します。
server ntp1.jst.mfeed.ad.jp
server ntp2.jst.mfeed.ad.jp
server ntp3.jst.mfeed.ad.jp

[root@hoge123~]# service ntpd start ← ntpサービスを起動します。
Starting ntpd:      [  OK  ]
[root@hoge123~]# chkconfig ntpd on ← ntpサービスが自動起動するようにします。
[root@hoge123~]# ntpq -p ← ntpが動作して、同期しているか確認します。

下図のように表示されれば、同期しています。5〜10分位待ってから試してください

     remote           refid      st t when poll reach   delay   offset  jitter
====================================================================
+ntp1.jst.mfeed. 210.173.160.56   2 u   36  128  377   26.210  -16.264   5.985
+ntp2.jst.mfeed. 210.173.160.86   2 u   68  128  377   26.182   -4.555  12.769
*ntp3.jst.mfeed. 210.173.160.86   2 u   36  128  377   26.152  -13.165   6.577


自宅サーバ構築(Scientific Linux6.3)に戻る


Copyright(C) PCDEMAGIC All Rights Reserved.