foldrr's weblog

旧ブログ http://d.hatena.ne.jp/foldrr/

CentOS ntpd インストール

インストール

初めから入っているのでインストールは不要。
インストール済みかの確認は以下でできる。

su -
yum list ntp

設定ファイルの編集

先にバックアップを作っておく。

cp /etc/ntp.conf /etc/ntp.conf.orig

設定ファイルの server を変更する。

# server 0.centos.pool.ntp.org
# server 1.centos.pool.ntp.org
# server 2.centos.pool.ntp.org
↓
server -4 ntp.nict.jp
server -4 ntp1.jst.mfeed.ad.jp
server -4 ntp2.jst.mfeed.ad.jp

サーバの起動

service ntpd start

サーバの常時起動

chkconfig ntpd on

サーバの状態確認

アスタリスクが付いていれば同期完了している。

ntpq -p