我们在运行Java 8u74 x64的CentOS 7 x64服务器上遇到了问题。
大约每6-10周一次。正在运行的JVM似乎松散了#34;它的时区设置几秒钟。
服务器时区是澳大利亚/珀斯(GMT + 8),但是几秒钟后,日志会打印没有时区数据的日期(就像回到时间8小时一样),然后又恢复正常。
通常打印日志:
2016-08-30T09:57:59.811+0800
但是几分钟后,日志会显示:
2016-08-30T09:57:59.811+0000 (ending in +0000 as in GMT)
执行检查:
-Duser.timezone=Australia/Perth
ntpd on
yum update tzdata
已完成yum update ntp
已完成yum update tzdata
已完成TZ=Australia/Perth
环境变量zdump -v /etc/localtime
zdump输出似乎有点奇怪
当我运行zdump -v /etc/localtime
时,我得到以下内容:
/etc/localtime -9223372036854775808 = NULL
/etc/localtime -9223372036854689408 = NULL
/etc/localtime Sat Nov 30 16:16:35 1895 UTC = Sat Nov 30 23:59:59 1895 LMT isdst=0 gmtoff=27804
/etc/localtime Sat Nov 30 16:16:36 1895 UTC = Sun Dec 1 00:16:36 1895 AWST isdst=0 gmtoff=28800
...
大约25个更正确的条目
...
/etc/localtime Sat Mar 28 17:59:59 2009 UTC = Sun Mar 29 02:59:59 2009 AWDT isdst=1 gmtoff=32400
/etc/localtime Sat Mar 28 18:00:00 2009 UTC = Sun Mar 29 02:00:00 2009 AWST isdst=0 gmtoff=28800
/etc/localtime 9223372036854689407 = NULL
/etc/localtime 9223372036854775807 = NULL
顶部和底部的那些NULL是一个问题吗?
关于还有什么可能导致问题的任何想法?
更新
好吧,问题再次发生,这次centos盒上的时钟落后3小时,ntpd似乎已经崩溃了。
好的,看看这个
[root@xotica admin]# date
Fri Oct 21 19:53:58 AWST 2016
[root@xotica admin]# service ntpd status
Redirecting to /bin/systemctl status ntpd.service
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2016-10-21 16:56:42 AWST; 2h 57min ago
Main PID: 32012 (code=exited, status=255)
Oct 21 16:56:35 xotica.dyndns.org ntpd[32012]: 202.127.210.37 interface 192.168.1.200 -> (none)
Oct 21 16:56:39 xotica.dyndns.org ntpd[32012]: Listen normally on 6 enp0s3 192.168.1.200 UDP 123
Oct 21 16:56:39 xotica.dyndns.org ntpd[32012]: new interface(s) found: waking up resolver
Oct 21 16:56:40 xotica.dyndns.org ntpd[32012]: 0.0.0.0 0628 08 no_sys_peer
Oct 21 16:56:41 xotica.dyndns.org ntpd[32012]: Listen normally on 7 enp0s3 fe80::a00:27ff:fea0:ecd8 UDP 123
Oct 21 16:56:41 xotica.dyndns.org ntpd[32012]: new interface(s) found: waking up resolver
Oct 21 16:56:42 xotica.dyndns.org ntpd[32012]: 0.0.0.0 0617 07 panic_stop +8960 s; set clock manually within 1000 s.
Oct 21 16:56:42 xotica.dyndns.org systemd[1]: ntpd.service: main process exited, code=exited, status=255/n/a
Oct 21 16:56:42 xotica.dyndns.org systemd[1]: Unit ntpd.service entered failed state.
Oct 21 16:56:42 xotica.dyndns.org systemd[1]: ntpd.service failed.
[root@xotica admin]# service ntpd restart
Redirecting to /bin/systemctl restart ntpd.service
[root@xotica admin]# date
Fri Oct 21 22:23:55 AWST 2016
[root@xotica admin]# service ntpd status
Redirecting to /bin/systemctl status ntpd.service
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2016-10-21 19:54:28 AWST; 2h 33min ago
Process: 32404 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 32405 (ntpd)
CGroup: /system.slice/ntpd.service
└─32405 /usr/sbin/ntpd -u ntp:ntp -g
Oct 21 19:54:28 xotica.dyndns.org ntpd[32405]: Listen normally on 2 lo 127.0.0.1 UDP 123
Oct 21 19:54:28 xotica.dyndns.org ntpd[32405]: Listen normally on 3 enp0s3 192.168.1.200 UDP 123
Oct 21 19:54:28 xotica.dyndns.org ntpd[32405]: Listen normally on 4 lo ::1 UDP 123
Oct 21 19:54:28 xotica.dyndns.org ntpd[32405]: Listen normally on 5 enp0s3 fe80::a00:27ff:fea0:ecd8 UDP 123
Oct 21 19:54:28 xotica.dyndns.org ntpd[32405]: Listening on routing socket on fd #22 for interface updates
Oct 21 19:54:30 xotica.dyndns.org ntpd[32405]: 0.0.0.0 c016 06 restart
Oct 21 19:54:30 xotica.dyndns.org ntpd[32405]: 0.0.0.0 c012 02 freq_set kernel -15.236 PPM
Oct 21 19:54:30 xotica.dyndns.org ntpd[32405]: 0.0.0.0 c61c 0c clock_step +8960.294249 s
Oct 21 22:23:50 xotica.dyndns.org ntpd[32405]: 0.0.0.0 c614 04 freq_mode
Oct 21 22:23:51 xotica.dyndns.org ntpd[32405]: 0.0.0.0 c618 08 no_sys_peer
有什么想法吗?