Fedora 36にNTP クライアントサーバーchronyとNTPStat をインストールする

2023年12月28日

環境
OSバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/redhat-release
Fedora release 36 (Thirty Six)
# cat /etc/redhat-release Fedora release 36 (Thirty Six)
# cat /etc/redhat-release
Fedora release 36 (Thirty Six)

NTP クライアントのインストール手順
1.chronyをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf -y install chrony
# dnf -y install chrony
# dnf -y install chrony

2.時刻同期する NTP サーバーを変更します
# vi /etc/chrony.conf
3行目
修正前
pool 2.centos.pool.ntp.org iburst

修正後

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#pool 2.centos.pool.ntp.org iburst
pool dlp.arkgame.com iburst
#pool 2.centos.pool.ntp.org iburst pool dlp.arkgame.com iburst
#pool 2.centos.pool.ntp.org iburst
pool dlp.arkgame.com iburst

3.chronyd自動起動を設定します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl enable --now chronyd
# systemctl enable --now chronyd
# systemctl enable --now chronyd

動作確認
# chronyc sources

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- 132.226.11.60 2 10 377 664 +623us[ +623us] +/- 30ms
^* ntp-b2.nict.go.jp 1 10 377 722 +529us[ +557us] +/- 5963us
^+ ipv4.ntp3.rbauman.com 2 10 377 48 +1046us[+1046us] +/- 6078us
^- ec2-3-114-30-212.ap-nort> 2 10 377 132 +1268us[+1268us] +/- 39ms
MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^- 132.226.11.60 2 10 377 664 +623us[ +623us] +/- 30ms ^* ntp-b2.nict.go.jp 1 10 377 722 +529us[ +557us] +/- 5963us ^+ ipv4.ntp3.rbauman.com 2 10 377 48 +1046us[+1046us] +/- 6078us ^- ec2-3-114-30-212.ap-nort> 2 10 377 132 +1268us[+1268us] +/- 39ms
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^- 132.226.11.60                 2  10   377   664   +623us[ +623us] +/-   30ms
^* ntp-b2.nict.go.jp             1  10   377   722   +529us[ +557us] +/- 5963us
^+ ipv4.ntp3.rbauman.com         2  10   377    48  +1046us[+1046us] +/- 6078us
^- ec2-3-114-30-212.ap-nort>     2  10   377   132  +1268us[+1268us] +/-   39ms

4.NTPStat をインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf -y install ntpstat
# dnf -y install ntpstat
# dnf -y install ntpstat

時刻同期を確認します
# ntpstat

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
synchronised to NTP server (133.243.238.163) at stratum 2
time correct to within 6 ms
polling server every 1024 s
synchronised to NTP server (133.243.238.163) at stratum 2 time correct to within 6 ms polling server every 1024 s
synchronised to NTP server (133.243.238.163) at stratum 2
   time correct to within 6 ms
   polling server every 1024 s

 

Fedora 36

Posted by arkgame