-->

2011-06-24

ntpq -pn の jitter が増える => 同期が外れる => jitter が増える ...

http://femt.ddo.jp/modules/xpwiki/?NTP%E3%82%B5%E3%83%BC%E3%83%90%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B

$ sudo ACCEPT_KEYWORDS="~*" emerge --oneshot -avt net-misc/adjtimex

CLOCK="local" だけで良い?
$ co /etc/config-archive/etc/conf.d/clock,v
$ sudo cp -i clock /etc/conf.d/

$ sudo adjtimexconfig
Comparing clocks (this will take 70 sec)...done.
Adjusting system time by 212.217 sec/day to agree with CMOS clock...done.

$ sudo /etc/init.d/adjtimex start
$ sudo rc-update add adjtimex default

$ sudo find /etc/ -mmin -10 -type f
/etc/init.d/adjtimex
/etc/conf.d/adjtimex
/etc/conf.d/clock
/etc/csh.env
/etc/profile.env

$ cat /etc/conf.d/adjtimex | grep -v ^# | grep -v ^$
TICK=10024
FREQ=3683912

$ grep -nP "DAEMON|OPTS|CONFD" /etc/init.d/adjtimex
6:DAEMON=adjtimex
7:OPTS="--tick ${TICK} --frequency ${FREQ}"
8:CONFD="/etc/conf.d/${DAEMON}"
16:    if [ ! -f "${CONFD}" ]; then
26:     ebegin "Regulating system clock with ${DAEMON}..."
27:     /usr/sbin/${DAEMON} ${OPTS}

サーバーは pool.ntp.org が4つ。初期値のまま。
非公開であれば st=1 のサーバーは回避したほうが良いです。
$ rcsdiff -u /etc/config-archive/etc/ntp.conf,v /etc/ntp.conf
===================================================================
RCS file: /etc/config-archive/etc/ntp.conf,v
retrieving revision 1.10
diff -u -r1.10 /etc/ntp.conf
--- /etc/ntp.conf       2011/06/24 00:01:17     1.10
+++ /etc/ntp.conf       2011/06/24 00:42:09
@@ -40,8 +40,10 @@

 # To deny other machines from changing the
 # configuration but allow localhost:
-restrict default nomodify nopeer
+restrict default nomodify nopeer noquery notrap
+restrict -6 default ignore
 restrict 127.0.0.1
+restrict -6 ::1


 # To allow machines within your network to synchronize
@@ -49,4 +51,4 @@
 # not allowed to configure the server or used as peers
 # to synchronize against, uncomment this line.
 #
-#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap
+restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap

$ netstat -an|grep -P ":123\s"
udp        0      0 192.168.0.100:123       0.0.0.0:*
udp        0      0 127.0.0.1:123           0.0.0.0:*
udp        0      0 0.0.0.0:123             0.0.0.0:*

http://l-w-i.net/t/fedora/ntp_100.txt

以前はjitterが時間が経つと増えていた。
jitterが700~、offsetが1500~程度で*,+などの同期が外れてdelay,offset,jitterが0に戻っていた。
*,+が付いていても別サーバーから ntpdate -d で Leap not in sync というエラーで同期できなかった。
$ ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+219.117.196.43  133.243.238.163  2 u   41   64  377   20.161    3.454  10.822
*61.206.115.3    133.100.9.2      2 u   46   64  377    5.578    5.977  11.265
+219.75.253.70   218.45.21.199    3 u   43   64  377   11.406    3.607  10.963
+183.177.167.6   133.100.9.2      2 u   45   64  377   10.268    6.898   7.830

0 件のコメント: