ntpdateで時刻同期すると一日ずれます。

このQ&Aのポイント
  • Linuxのntpdateを使用して時刻同期を行うと、一日ずれが発生します。
  • 他のサーバに接続しても同様の問題が発生します。
  • 問題の原因は現在不明ですが、ntpパッケージは正しくインストールされています。
回答を見る
  • ベストアンサー

ntpdateで時刻同期すると一日ずれます。

Linuxでntpdateで時刻同期すると一日ずれます。 # date 2010年 11月 11日 木曜日 09:34:21 JST 今日は11月10日です。 # date -s 20101110 2010年 11月 10日 水曜日 00:00:00 JST #ntpdate -b ntp.nict.jp 11 Nov 09:35:24 ntpdate[22948]: the NTP socket is in use, exiting # date 2010年 11月 11日 木曜日 09:35:28 JST なぜか11日にもどされます。 # hwclock --show # 何も表示されません。 # cat /etc/sysconfig/clock ZONE="Asia/Tokyo" UTC=true ARC=false 他のサーバにつないでも同様でした。 # date -s 20101110 2010年 11月 10日 水曜日 00:00:00 JST #ntpdate -b eric.nc.u-tokyo.ac.jp 11 Nov 12:30:03 ntpdate[23329]: step time server 130.69.251.23 offset -86403.273202 sec # ntpdate -b 11 Nov 12:31:01 ntpdate[23331]: no servers can be used, exiting # ntpdate -b ntp.sut.ac.jp 11 Nov 12:31:13 ntpdate[23332]: step time server 133.31.180.6 offset -86403.269931 sec # ntpdate -s ntp.sut.ac.jp # date 2010年 11月 11日 木曜日 12:31:33 ntpはもちろんはいっています。 #rpm -qa ntp ntp-4.2.2p1-9.el5.centos.2.1 よろしければアドバイスをいただけないでしょうか?

質問者が選んだベストアンサー

  • ベストアンサー
  • Wr5
  • ベストアンサー率53% (2177/4070)
回答No.3

># ll /proc/driver/rtc >ls: /proc/driver/rtc: そのようなファイルやディレクトリはありません 少なくとも、実行中のカーネルでRTCドライバが動作していませんね。 特殊なハードでも使用しているんですか?

purin2010
質問者

お礼

ありがとうございます。ゲストOSで作業をしていて、 ホストOSの日付がずれていたとのことでした。 ありがとうございました。^^

その他の回答 (2)

  • Wr5
  • ベストアンサー率53% (2177/4070)
回答No.2

ハードウェアは何を使用しています? hwclockで情報が出ない…というのも珍しいような。 rtcのドライバが入っていないんでしょうか? # /proc/driver/rtcがないとか、/dev/rtcがないとか? /proc/interruptsにもrtcあるかと思うのですが…。 /proc/devicesの方はどうですかね? カーネルのバージョンとか…。 >#ntpdate -b ntp.nict.jp >11 Nov 09:35:24 ntpdate[22948]: the NTP socket is in use, exiting NTPサーバが同期用にソケット使用中…ということかと。

purin2010
質問者

補足

ありがとうございます。 以下のような感じでした。 # ll /proc/driver/rtc ls: /proc/driver/rtc: そのようなファイルやディレクトリはありません # ll /dev/rtc crw------- 1 root root 10, 135 11月 9 19:27 /dev/rtc 同期に失敗しているのでしょうか??

  • SaKaKashi
  • ベストアンサー率24% (755/3136)
回答No.1

TZは?

purin2010
質問者

補足

ありがとうございます。 環境変数にはなかったのですが。 locateでもありませんでした。 TZというのはどこを見ればよいでしょうか?

関連するQ&A

  • Linuxでの大きな時刻ずれについて

    Linux(Vine 4.1)で、ntpdateとhwclockを使って、毎日時刻あわせをしています。 crontabはこんな感じです。 0 2 * * * /usr/sbin/ntpdate -s ntp1.jst.mfeed.ad.jp 1 2 * * * /sbin/hwclock --systohc ところが、毎日9700秒以上と、大幅に時計が狂ってしまいます。 syslog出力を抜粋するとこんな感じです。 Nov 28 23:17:22 step time server 210.173.160.27 offset -9757.742092 sec Nov 29 01:41:39 step time server 210.173.160.27 offset -1099.305344 sec Nov 29 01:57:54 step time server 210.173.160.27 offset -124.151414 sec Nov 29 01:59:44 step time server 210.173.160.27 offset -15.801794 sec Nov 29 23:17:25 tep time server 210.173.160.27 offset -9753.300387 sec Nov 30 01:41:38 tep time server 210.173.160.27 offset -1101.564751 sec Nov 30 01:57:56 tep time server 210.173.160.27 offset -124.151818 sec Nov 30 01:59:47 tep time server 210.173.160.27 offset -13.541277 sec Nov 30 23:17:23 step time server 210.173.160.27 offset -9757.256311 sec Dec 1 01:41:38 step time server 210.173.160.27 offset -1102.220379 sec Dec 1 01:57:56 step time server 210.173.160.27 offset -124.151101 sec Dec 1 01:59:46 step time server 210.173.160.27 offset -13.544078 sec adjtimexを使って、ticやfrequencyを変更して対応しようとしたんですが、 adjtimexコマンドの設定範囲を超えているほどのずれのようです。 hwclock --showで確認すると、hardware clockの方はずれていません。 ずれの原因と補正方法が推測できれば、教えていただきたいと思います。 よろしくお願いします。

  • ntpdate: デバッグモードでしか応答が取れません

    ■1■あるntpサーバに対して下記を実行すると、 % ntpdate 133.xxx.x.xxx Looking for host 133.xxx.x.xxx and service ntp host found : xxx.xxx.co.jp 7 Apr 13:29:46 ntpdate[11129]: no server suitable for synchronization found とエラーとなるのですが、 ■2■デバッグ(?)オプションを付けると、 % ntpdate -d 133.xxx.x.xxx 7 Apr 13:46:25 ntpdate[11146]: ntpdate 4.2.0@1.1161-r Fri Apr 7 11:35:09 JST 2006 (1) Looking for host 133.xxx.x.xxx and service ntp host found : xxx.xxx.co.jp transmit(133.xxx.x.xxx) receive(133.xxx.x.xxx) : delay 0.03502, dispersion 0.00020 offset -525.818942 7 Apr 13:57:03 ntpdate[11149]: step time server 133.xxx.x.xxx offset -525.818942 sec と、応答は返ってくるようです。 デバッグモードではなく、正式にntpサーバの時刻をこのLinuxサーバに 設定したいのですが、上記の状況を回避するには、どのようにすれば良いでしょうか。 よろしくお願いします。 ■補足■ ・Red Hat Linux release 8.0 を使っています。 ・ntpdは登録していないです 以上よろしくお願いします。

  • ntpdateで時刻調整

    RedHat Linux ESを使用しています。 ntpdate -u -s eric.nc.u-tokyo.ac.jp というように、ntpdateコマンドで時刻調整をしたところ、時刻が2時間進んでしまいました。 ntpサーバの時刻があってないのかと思ったのですが 他のマシン(RedHat Linux 8.0)では、全く問題ありませんでした。 OSのバージョンによるバグなのでしょうか? 何か参考になる情報などありましたら、教えていただきたいと思います。

  • ntpdateコマンドについて

    Linux7.2サーバで時刻修正コマンド /usr/sbin/ntpdate time-nw.nist.gov と入力すると 20 Nov 10:04:54 ntpdate[22117]: no server suitable for synchronization found このようなエラーがでます。 ntpサーバを他のものに変えても同じ結果になります。 正常に動作させるには、どうしたらよいでしょうか?

  • NTPによる時刻同期

    よろしくお願いします。NTPで同期ができなくて困っています。 当方、Windows2000サーバのWindowsTimeを使って内部NTPサーバを立てていますが、 この2000サーバに対してWindowsクライアントから同期をとると成功しますが、 Linuxクライアントからは失敗してしまいます。 ですが、このLinuxクライアントから外部の公開NTPサーバに対しては成功します。 W2K⇔Linuxの場合、特別な設定が必要なのでしょうか? ※失敗例 [root@hogehoge ~]# ntpdate -d 172.16.10.200 25 Sep 16:07:07 ntpdate[31987]: ntpdate 4.2.0a@1.1190-r Sun Aug 13 01:49:13 CDT 2006 (1) Looking for host 172.16.10.200 and service ntp host found : transmit(172.16.10.200) receive(172.16.10.200) transmit(172.16.10.200) receive(172.16.10.200) transmit(172.16.10.200) receive(172.16.10.200) transmit(172.16.10.200) receive(172.16.10.200) transmit(172.16.10.200) 172.16.10.200: Server dropped: Server has gone too long without sync server 172.16.10.200, port 123 stratum 2, precision -7, leap 00, trust 000 refid [172.16.10.200], delay 0.03358, dispersion 0.00031 transmitted 4, in filter 4 reference time: 00000000.00000000 Thu, Feb 7 2036 15:28:16.000 originate timestamp: caa3321b.c4189374 Tue, Sep 25 2007 16:07:07.766 transmit timestamp: caa3321b.a609edbf Tue, Sep 25 2007 16:07:07.648 filter delay: 0.03470 0.03358 0.03363 0.03363 0.00000 0.00000 0.00000 0.00000 filter offset: 0.118582 0.117779 0.117554 0.117305 0.000000 0.000000 0.000000 0.000000 delay 0.03358, dispersion 0.00031 offset 0.117779 25 Sep 16:07:07 ntpdate[31987]: no server suitable for synchronization found ※他のサーバでは成功しているし、Portも開放しているつもりです [root@hogehoge ~]# netstat -a -n | grep :123 udp 0 0 172.16.10.10:123 0.0.0.0:* udp 0 0 192.168.0.1: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:* udp 0 0 :::123 :::* ※ntp.conf [root@hogehoge etc]# cat ntp.conf # server 134.***.***.*** server 172.16.10.200 restrict default notrap nomodify noquery notrust noserve restrict 127.0.0.1 # restrict 172.16.0.0 mask 255.255.0.0 nopeer notrap nomodify restrict 172.16.10.200 mask 255.255.255.255 nopeer notrap nomodify restrict 134.160.82.20 mask 255.255.255.255 nopeer notrap nomodify server 127.127.1.0 fudge 127.127.1.0 stratum 11 driftfile /var/lib/ntp/drift disable auth ※このように、172.16.10.200はremoteの出力がありません。  なぜでしょうか・・・ [root@hogehoge etc]# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== *ring.***.*** 134.***.***.*** 2 u 4 64 37 29.347 9.640 16.800 0.0.0.0 2 u 3 64 0 0.000 0.000 4000.00 LOCAL(0) LOCAL(0) 11 l 1 64 37 0.000 0.000 0.001 以上、よろしくお願いします

  • Linuxの時計のズレ

    一時間おきにNTPサーバへ時刻調整をしています。 以下はntpdateを利用した時のリザルトなのですが、 1.17秒も一時間でズレるものなのでしょうか? ntpdateの後はclock -wも毎回やってます。 ntpdate[21131]: step time server *.*.*.* offset -1.172693 sec

  • 時間合わせについて

    初歩的で恥ずかしいのですが、時間合わせができなくて困ってます。 [実際の時間] Fri Jun 24 12:29:50 JST 2005 [freeBSDの時間] Fri Jun 24 21:29:50 JST 2005 と9時間ずれてしまいます。 ntpdate 211.9.32.200 で時間あわせをしようとすると下記のようなメッセージが返ってくるのですが、freeBSDの時間は変わらないままです。 24 Jun 21:32:38 ntpdate[185]: step time server 211.9.32.200 offset -32262.087398 sec date 200506271229 としても、freeBSDの時間は変わらないままです。 何か解決法があればご教授願います。

  • dateとntpdateによる時間設定

    こんにちわ。 会社で使用している古いUNIXサーバのdateのセットで質問です。 OSは「BSDI BSD/OS 4.0.1」です。 症状はヘルプの例通りにセットしようとした時、 時間を先に進めるのは問題なくできたのですが、 過去の時間をセットしようとすると下記のメッセージが出てきます。 [作業前のセットされている時間 2002/02/04 16:30] % date 0202041640 → 問題ないです。 ----------- % date 0202011200 date: settimeofday: elevated security level: Operation not permitted というメッセージが出て何も変更されない。 rootでログインして実施してるのですが何故でしょうか? 特別なコマンドでもあるのでしょうか? あと社内にあるNTPサーバから時刻同期をしようとしても問題があります。 % ntpdate clock.****.****.co.jp とコマンドを入力するとRedhat7.2なら 4 Feb 16:37:05 ntpdate[22138]: step time server 10.**.**.** offset -179.826032 sec とメッセージが出て同期が取られるのですが BSD/OSの場合、 4 Feb 16:36:24 ntpdate[8573]: adjust time server 10.**.**.** offset -101.622156 sec と出て同期を取ってくれません。 古いOSで申し訳ないですが宜しくお願いします。

  • CentOSのNTP時刻同期エラー

    表題の通りCentOSのNTPサーバーエラーについて質問します。 状況 CentOSでNTPを使用していたのですが、気がついた時には NTPサーバーがエラーで止まっていました。  内容を確認してみると、/etc/ntp.confで設定している同期するサーバーと ntpq -p で確認するサーバーが違っている事に気が付きました。 このntpqコマンドで確認できるサーバーは、昔使っていた古いアドレスの物で 現在は使われていない為に今回のエラーになっていると考え、 設定されている場所を探したのですが、見つからなかった為、 yum erase ntp* で一旦全て削除して、 yum install ntp* で再インストールを 行いましたが、状態が変わりませんでした。 現在のntp.confの内容============================================== # Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. #restrict default kod nomodify notrap nopeer noquery #restrict -6 default kod nomodify notrap nopeer noquery # Permit all access over the loopback interface. This could# be tightened as well, but to do so would effect some o f# the administrative functions.#restrict 127.0.0.1 #restrict -6 ::1 #ipv6 # Hosts on local network are less restricted. # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). #server 0.centos.pool.ntp.org #server 1.centos.pool.ntp.org #server 2.centos.pool.ntp.org server 133.100.9.2 #clock.nc.fukuoka-u.ac.jp server 210.173.160.27 #ntp1.jst.mfeed.ad.jp server 202.224.32.4 #ntp.asahi-net.or.jp #broadcast 192.168.1.255 key 42 # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 key 42 # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 key 42 # manycast client # Undisciplined Local Clock. This is a fake driver intended for backup # and when no outside source of synchronized time is available. #server 127.127.1.0 # local clock #fudge 127.127.1.0 stratum 10 # Drift file. Put this in a directory which the daemon can write to. # No symbolic links allowed, either, since the daemon updates the file # by creating a temporary in the same directory and then rename()'ing # it to the file. driftfile /var/lib/ntp/drift # Key file containing the keys and key identifiers used when operating # with symmetric key cryptography. keys /etc/ntp/keys # Specify the key identifiers which are trusted. #trustedkey 4 8 42 # Specify the key identifier to use with the ntpdc utility. #requestkey 8 # Specify the key identifier to use with the ntpq utility. #controlkey 8 ======================================================== ntpq -p で確認した内容==================================== remote refid st t when poll reach delay offset jitter ============================================================================== clock.nc.fukuok .GPS. 1 u 45 64 1 25.585 22436.7 0.002 ntp1.jst.mfeed. 210.173.176.251 2 u 44 64 1 5.803 22465.5 0.002 orion.asahi-net 133.243.238.244 2 u 43 64 1 5.787 22495.2 0.002 ============================================================================== この時、/var/log/messageには何もログは表示されていません。 また、ntpdate -u -b clock.nc.fukuoka-u.ac.jp で強制的に時刻同期させると 以下のように時刻の同期ができます。 29 Sep 22:17:15 ntpdate[29572]: step time server 133.100.9.2 offset 27.863054 sec 以上の内容から、ntpq -p で表示されている古いサーバー情報がどこかに 残っている為に、今回のエラーになっていると思えるのですが、 自分では、どこに残っているのかがわからない為、 皆様のお知恵をお借りできれば幸いです。 宜しくお願い致します。

  • NTP時刻ずれの確認方法について

    Linux(CentOS)に2つのネットワークインタフェース(eth0,eth1)を設けて、eth0では ntpdate -b "NTPサーバAのアドレス"として、とあるネットワーク網のNTPサーバAと時刻同期をさせ、その後に、eth1で別のネットワーク網にあるNTPサーバとの時刻ずれを確認したいと考えています。 その際eth1側で、時刻同期を行わずに、時刻ずれだけを確認できるコマンド(ntpdateのオプション?)というものはあるでしょうか? 教えていただけないでしょうか? よろしくお願いいたします。