NTPサーバーの問題。慌てて3時間先に行きました。

NTPサーバーの問題。慌てて3時間先に行きました。

私が何を間違って設定したのかわからないので、信頼できるNTPサーバーを起動して実行することはできません。これはイントラネットのntpサーバーにすぎません。

サーバーはスラックウェアシステムなので、構成ファイルは私が見つけたテンプレートに基づいています。

interface ignore wildcard
interface listen 127.0.0.1
interface listen eth0
interface listen eth1
server 3.gr.pool.ntp.org iburst
server 1.europe.pool.ntp.org iburst
server 0.europe.pool.ntp.org iburst
server  127.127.1.0 # local clock
fudge   127.127.1.0 stratum 10  
driftfile /etc/ntp/drift
multicastclient 224.0.1.1       # listen on default 224.0.1.1
broadcastdelay  0.008
restrict default kod nomodify notrap noquery nopeer
restrict 3.gr.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 1.europe.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 0.europe.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 192.168.18.0 mask 255.255.255.0 nomodify notrap
restrict 127.0.0.1
logfile /var/log/ntp.log

コメント付きのconfダンプについては、以下を参照してください。 http://pastebin.com/TP0KyRV7

192.168.18.0ネットワークは、このntpサーバーによって提供されるローカルイントラネットです。

過去数ヶ月間のログの断片です。役に立つ情報は見えません。

30 Nov 15:41:12 ntpd[28591]: 194.177.210.54 interface 192.168.201.210 -> (none)
30 Nov 15:41:12 ntpd[28591]: Deleting interface #1 eth0, 192.168.18.10#123, interface stats: received=136483, sent=136483, dropped=0, active_time=7277307 secs
30 Nov 15:41:12 ntpd[28591]: Deleting interface #0 lo, 127.0.0.1#123, interface stats: received=0, sent=0, dropped=0, active_time=7277307 secs
30 Nov 15:41:12 ntpd[28591]: 127.127.1.0 interface 127.0.0.1 -> (none)
30 Nov 15:41:12 ntpd[28591]: peers refreshed
30 Nov 15:41:15 ntpd[28591]: ntpd exiting on signal 15
 1 Dec 13:56:56 ntpd[1650]: Listen normally on 6 multicast 224.0.1.1 UDP 123
 1 Dec 13:56:56 ntpd[1650]: Joined 224.0.1.1 socket to multicast group 224.0.1.1
 5 Dec 22:51:42 ntpd[18694]: Listen normally on 6 multicast 224.0.1.1 UDP 123
 5 Dec 22:51:42 ntpd[18694]: Joined 224.0.1.1 socket to multicast group 224.0.1.1
27 Feb 14:17:23 ntpd[18694]: Deleting interface #5 lo, ::1#123, interface stats: received=0, sent=0, dropped=0, active_time=7226742 secs
27 Feb 14:17:23 ntpd[18694]: Deleting interface #4 eth0, fe80::21a:92ff:fe3a:ac17#123, interface stats: received=0, sent=0, dropped=0, active_time=7226742 sec
s
27 Feb 14:17:23 ntpd[18694]: Deleting interface #3 eth1, fe80::211:6bff:fe32:f77e#123, interface stats: received=0, sent=0, dropped=0, active_time=7226742 sec
s
27 Feb 14:17:23 ntpd[18694]: Deleting interface #2 eth0, 192.168.18.10#123, interface stats: received=120122, sent=120122, dropped=0, active_time=7226742 secs
27 Feb 14:17:23 ntpd[18694]: Deleting interface #1 eth1, 192.168.201.210#123, interface stats: received=6261, sent=7292, dropped=0, active_time=7226742 secs
27 Feb 14:17:23 ntpd[18694]: 155.207.113.227 interface 192.168.201.210 -> (none)
27 Feb 14:17:23 ntpd[18694]: Deleting interface #0 lo, 127.0.0.1#123, interface stats: received=0, sent=0, dropped=0, active_time=7226742 secs
27 Feb 14:17:23 ntpd[18694]: 127.127.1.0 interface 127.0.0.1 -> (none)
27 Feb 14:17:23 ntpd[18694]: peers refreshed
27 Feb 14:17:27 ntpd[18694]: ntpd exiting on signal 15
27 Feb 17:32:45 ntpd[1642]: Listen normally on 6 multicast 224.0.1.1 UDP 123
27 Feb 17:32:45 ntpd[1642]: Joined 224.0.1.1 socket to multicast group 224.0.1.1
12 Mar 22:11:51 ntpd[9153]: Listen normally on 6 multicast 224.0.1.1 UDP 123
12 Mar 22:11:51 ntpd[9153]: Joined 224.0.1.1 socket to multicast group 224.0.1.1
12 Mar 22:11:51 ntpd[9153]: ntpd: time slew +0.000000 s
12 Mar 19:40:09 ntpd[9564]: Listen normally on 6 multicast 224.0.1.1 UDP 123
12 Mar 19:40:09 ntpd[9564]: Joined 224.0.1.1 socket to multicast group 224.0.1.1

しかし、時にはNTPサーバーが動作を停止することがあります。再確認してみると3時間前だった。私はその3時間がランダムな数字だとは思わない。これは私がEET(またはEEST)にいるという事実に関連しているかもしれません。

BIOS時間が現地時間に設定されています(Linuxでこの時間を確認するにはどうすればよいですか?)

実行した後、ntpdate 3.gr.pool.ntp.org次のようになります。

root@halki:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+postmortem.csd. 122.231.59.246   2 u   18   64    1   15.646   21.219   0.471
*ntp.jine.se     192.36.144.22    2 u   16   64    1   78.292    3.687   0.251
+static-ip-85-25 192.168.100.15   2 u   15   64    1   50.748   -2.676   1.071
 LOCAL(0)        .LOCL.          10 l   25   64    1    0.000    0.000   0.000

私のntp.confに問題がありますか?

たぶん私のシステムのタイムゾーン設定に関連していますか?

これらをどのように確認するのかわかりません。数年前、インストール中に「Europe / Athens」を選択しましたが、タイムゾーン変数$ TZをエコーすると空の文字列が返されました。

date今としては合うようですが、ずっと維持されるかはわかりません。

root@halki:~# date
Thu Mar 12 20:22:39 EET 2015

誰が何が間違っている可能性があるかを確認する必要があるものについてのアドバイスを提供できますか?

編集する

Slackware Linuxでは、ハードウェアクロックの設定ファイルはにあります/etc/hardwareclock。私の場合は「現地時間」に設定されています。このファイルは、/etc/rc.d/rc.S時計をUTCまたは現地時間に設定するために起動中にチェックされます。

ところでRTCに問題があるようです。

root@halki:/etc# hwclock --show --debug
hwclock from util-linux 2.21.2
hwclock: Open of /dev/rtc failed: No such file or directory
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.

これは正常ではないと思います。たぶん私のカーネルに何かが落ちたかもしれませんが、誰でも確認できますか?

ベストアンサー1

しかし、時にはNTPサーバーが動作を停止することがあります。再確認してみると3時間前だった。私はその3時間がランダムな数字だとは思わない。これは私がEET(またはEEST)にいるという事実に関連しているかもしれません。

これは、マシンが再起動して時間がめちゃくちゃになるという意味である場合、オペレーティングシステムがハードウェアクロックが時間をUTCとしてマークすると誤って信じているためです。これにより、ハードウェアの応答時間が3時間長くなります。

したがって、再起動後に問題が発生した場合は、OSハードウェアに時間をローカル時間(日付出力に応じてEETタイムゾーンにある)として保存するように指示します。

# hwclock --localtime

date -d次に、正しい時間が得られるまでシステム時間を調整します。最後に、ハードウェアの時計に時間を保存します。

# hwclock --systohc

BIOS時間が現地時間に設定されています(Linuxでこの時間を確認するにはどうすればよいですか?)

hwclockここに保存されている日付を指定しますが、それをUTCまたは現地時間として処理するのが正しいかどうかはわかりません。

これらをどのように確認するのかわかりません。数年前、インストール中に「Europe / Athens」を選択しましたが、タイムゾーン変数$ TZをエコーすると空の文字列が返されました。

あなたのタイムゾーンはとして印刷されますdate/etc/timezoneヨーロッパ/アテネなどのタイムゾーン名を含めることができること、または/etc/localtimeにあるファイルなどのタイムゾーン情報データを含むファイルを含めることができることを確認してください/usr/share/zoneinfo

おすすめ記事