今更だけどubuntu 22.04→24.04→26.04アップデート(3) NTPdやめるって、Chronyにするって munin関係も
ずっと時刻同期でntpdを使っていたが、そろそろubuntu標準の方法に変えるかと思って調べていた。なんとなく、時刻の提供機能が無いシステムがあってそっちに標準かわっていたなというのは知っていた。時刻の提供機能はいらないし、それでいいやと思っていたら、そのsystemd-timesyncdも25.04の頃に標準の座から下りて現在は
なんとびっくりChronyになっているらしい。繰り返すがびっくり。
なので、これもChronyに変更しよう
まずはntpをとめる、サービスの停止、自動起動を停止、パッケージを削除
sudo systemctl stop ntp
sudo systemctl disable ntp
sudo apt purge ntp
Chronyのインストールをする。起動時に自動起動にする
sudo apt update
sudo apt install chrony
sudo systemctl enable --now chrony
/etc/chrony/sources.d/ubuntu-ntp-pools.sources の編集
pool 1.ntp.ubuntu.com iburst maxsources 1 nts preferpool 2.ntp.ubuntu.com iburst maxsources 1 nts preferpool 3.ntp.ubuntu.com iburst maxsources 1 nts preferpool 4.ntp.ubuntu.com iburst maxsources 1 nts prefer
などをコメントアウト YamahaのRTX-1210で動いているサーバーに接続するので
pool 192.168.0.254 iburst
を追加する。サービスの再起動と同期の状態の確認
sudo systemctl restart chrony
sudo watch chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* _gateway 1 6 77 5 +153us[ +402us] +/- 23ms
===============================================================================
^* _gateway 1 6 77 5 +153us[ +402us] +/- 23ms
MSの欄の1つ目 ^ がサーバーモード、* が同期中
NTPdよりかなりはやい、状態確認したらすでに同期している感じ。
さらにmunin関係の設定
munin-nodeで
- munin-node NTP kernel PLL frequency
- NTP kernel PLL offset (secs)
- NTP timing statistics for system peer
のグラフを作っているので /etc/munin/plugins/の
- ntp_kernel_err
- ntp_kernel_pll_freq
- ntp_kernel_pll_off
- ntp_offset
らを消して、munin-nodeを再起動する。
cd /etc/munin/plugins/
sudo rm ntp_kernel_err
sudo rm ntp_kernel_pll_freq
sudo rm ntp_kernel_pll_off
sudo rm ntp_offset
sudo systemctl restart munin-node
munin が動いているサーバーの/var/lib/munin/ServerでNTP関係の*.rrdを削除する
コメント
コメントを投稿