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

自宅サーバ構築MY HOME SERVER

サーバ時刻設定(NTP)

- サーバ時刻設定(NTP) -

ntpサーバーに接続して正確な時間を自動取得するようにします。

      
[root@hoge123 ~]# mv /etc/ntp.conf /etc/ntp.conf.org
[root@hoge123 ~]# vi /etc/ntp.conf

下記内容を追記します。
server ntp1.jst.mfeed.ad.jp
server ntp2.jst.mfeed.ad.jp
server ntp3.jst.mfeed.ad.jp

[root@hoge123 ~]# ntpdate -u ntp1.jst.mfeed.ad.jp ← 手動取得します。
18 Apr 00:12:07 ntpdate[41859]: adjust time server XXX.XXX.XXX.XXX offset -0.001978 sec
[root@hoge123 ~]# vi /etc/rc.conf

ntpd_enable="YES" ← 追記します。

[root@hoge123 ~]# /etc/rc.d/ntpd start
[root@hoge123 ~]# ntpq -p ← 同期しているか確認するコマンドです。同期になるまで5分程度かかります。

     remote           refid      st t when poll reach   delay   offset  jitter
======================================================================
*ntp1.jst.mfeed. 210.173.160.86   2 u  251  512  377   26.871   -2.285   0.185
+ntp2.jst.mfeed. 210.173.160.86   2 u  141  512  377   26.549   -2.104   0.137
+ntp3.jst.mfeed. 210.173.176.4    2 u  231  512  377   26.398   -2.343   0.534


自宅サーバ構築(FreeBSD9)に戻る


Copyright(C) PCDEMAGIC All Rights Reserved.