LoginSignup
1
3

More than 5 years have passed since last update.

CentOS 7 NTPの変更

Last updated at Posted at 2018-02-25

動作確認環境

  • 仮想環境 VMware Workstation Player 14.1.1
  • OS Windows 10 Pro 64bit

仮想環境

  • OS CentOS 7.4 (1708) minimalインストール
  • メモリ 2GB
  • HDD 250GB

初回の時計合わせ

初回は手動で時計合わせを行う。以下のコマンドを実行する。
この状態では「ntpdate: コマンドが見つかりません」と表示されるので、CentOS 7 OSインストール後の初期設定の「基本パッケージのインストール」のyum -y groupinstall baseを実行してから行うと良い。

ntpdate ntp.nict.jp

自動のNTPサーバ修正

オリジナルの設定ファイルをバックアップする。

cp -a -p /etc/chrony.conf /etc/chrony.conf.org

設定ファイルを修正する。

vi /etc/chrony.conf

以下のように修正する。

/etc/chrony.conf
server ntp.nict.jp
server ntp.nict.jp
server ntp.nict.jp

自動で起動するように設定する。

systemctl enable chronyd

起動する。

systemctl start chronyd

動作確認

10分ほど経過したら動作を確認する。

chronyc sources -v

以下のような表示があれば成功。

^+ ntp-a3.nict.go.jp 1 6 77 59 +972us[ +972us] +/- 5667us
^- ntp-b2.nict.go.jp 1 6 77 61 +1423us[+1423us] +/- 3830us
^* ntp-a2.nict.go.jp 1 6 77 62 +269us[ +547us] +/- 4458us

目次

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3