Posted at

chrony導入メモ@Debian8

More than 1 year has passed since last update.

Debian 8にそれっぽい感じでChronyをインストールする際の設定を紹介します.完全に個人的な備忘録です.Debian 8なのは,OpenBlocks 600Dがまだ現役だから.

pool directiveを使えばスマートにかけますが,Debian 8では,v1.30でpool directiveが使えません.残念.

# dpkg -l | grep chrony

ii chrony 1.30-2+deb8u1 powerpc Set the computer clock from time servers on the Net

以下インストール手順.


インストール

apt install chrony

cp /etc/chrony/chrony.conf /etc/chrony/chrony.conf.orig
vim /etc/chrony/chrony.conf
diff -u --to-file=/etc/chrony/chrony.conf /etc/chrony/chrony.conf.orig
service chrony restart

コンフィグは以下.


/etc/chrony/chrony.conf

--- /etc/chrony/chrony.conf.orig        2016-05-10 01:02:04.684764657 +0900

+++ /etc/chrony/chrony.conf 2016-05-10 01:08:58.000000000 +0900
@@ -17,11 +17,46 @@
# fails they will be discarded. Thus under some circumstances it is
# better to use IP numbers than host names.

-server 0.debian.pool.ntp.org offline minpoll 8
-server 1.debian.pool.ntp.org offline minpoll 8
-server 2.debian.pool.ntp.org offline minpoll 8
-server 3.debian.pool.ntp.org offline minpoll 8
+# server 0.debian.pool.ntp.org offline minpoll 8
+# server 1.debian.pool.ntp.org offline minpoll 8
+# server 2.debian.pool.ntp.org offline minpoll 8
+# server 3.debian.pool.ntp.org offline minpoll 8

+# option iburst, prefer: version 1.25
+# pool directive: version 2.00
+
+# nict
+#pool ntp.nict.jp prefer minpoll 6 maxpoll 10
+server ntp.nict.jp iburst prefer minpoll 6 maxpoll 10
+server ntp.nict.jp iburst prefer minpoll 6 maxpoll 10
+server ntp.nict.jp iburst prefer minpoll 6 maxpoll 10
+
+# mfeed
+#pool ntp.jst.mfeed.ad.jp prefer iburst minpoll 6 maxpoll 10
+server ntp1.jst.mfeed.ad.jp iburst minpoll 6 maxpoll 10
+server ntp2.jst.mfeed.ad.jp iburst minpoll 6 maxpoll 10
+server ntp3.jst.mfeed.ad.jp iburst minpoll 6 maxpoll 10
+
+# OCN
+server ntp-tk01.ocn.ad.jp iburst prefer minpoll 6 maxpoll 10
+server ntp-tk02.ocn.ad.jp iburst prefer minpoll 6 maxpoll 10
+
+# pool.ntp.org
+#pool jp.pool.ntp.org iburst minpoll 6 maxpoll 10
+#pool 0.jp.pool.ntp.org minpoll 6 maxpoll 10
+#pool 1.jp.pool.ntp.org minpoll 6 maxpoll 10
+#pool 2.jp.pool.ntp.org minpoll 6 maxpoll 10
+#pool 3.jp.pool.ntp.org minpoll 6 maxpoll 10
+server 0.jp.pool.ntp.org iburst minpoll 6 maxpoll 10
+server 1.jp.pool.ntp.org iburst minpoll 6 maxpoll 10
+server 2.jp.pool.ntp.org iburst minpoll 6 maxpoll 10
+server 3.jp.pool.ntp.org iburst minpoll 6 maxpoll 10
+
+# ring
+#pool ntp.ring.gr.jp iburst minpoll 6 maxpoll 10
+#server ntp0.ring.gr.jp iburst minpoll 6 maxpoll 10
+#server ntp1.ring.gr.jp iburst minpoll 6 maxpoll 10
+#server ntp2.ring.gr.jp iburst minpoll 6 maxpoll 10

# Look here for the admin password needed for chronyc. The initial
# password is generated by a random process at install time. You may


allow 192.168.11.0/24

local stratum 10

サービスを有効にして,同期状況を確認する.

systemctl enable chrony

insserv -s | grep chrony
chronyc sources
chronyc tracking
rtcfile /var/lib/chrony/rtc
rtcsync