1
0

More than 1 year has passed since last update.

私的サーバー構築日誌:NTPクライアント

Posted at

能書き

私的サーバー構築日誌:仕切り直しからの自宅サーバー構築の続きです。

時刻同期はサーバーのみならずクライアントでも必須です。テスト用には時刻をわざとずらせるようにした方が都合が良い事も多いんですが、それはまた別の話。

systemd-timesyncdが勝手に動いてるので放置しておけば良いのですけども。日本人が日本にサーバーを立てるなら、NTPサーバーはやはりntp.nict.jpではないかと考える次第です。

目標

と言う訳で、NTP サーバをデフォルトから変更し、ntp.nict.jpにします。

参考文献

準備

今回は/etcの修正だけなので、スナップショットは不要でしょう。気になる方は撮って下さい。

NTP クライアントが動いている事を確認します。

systemctl status systemd-timesyncd

または

timedatectl timesync-status

設定

sudo sed -i -e"/^#NTP=/c NTP=ntp.nict.jp" /etc/systemd/timesyncd.conf
sudo systemctl restart systemd-timesyncd

確認

準備と同じコマンドを実行して確認します。

特に難しい事も無いので、一発で行けるでしょう。

仕舞い

/etcの修正をバージョン管理しておきます。

cd /etc
sudo svn ci -m"setting NTP client"
1
0
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
0