zoukankan      html  css  js  c++  java
  • linux内核日志时间和date时间不一致,正好相差12小时

    发现linux的系统时间和系统日志记录时间不一致

    [root@nginx ~]# tail -fn 10 /var/log/messages
    Sep 19 23:11:47 nginx Keepalived_vrrp[127945]: Sending gratuitous ARP on eth1 for 192.168.100.100
    Sep 19 23:11:47 nginx Keepalived_vrrp[127945]: Sending gratuitous ARP on eth1 for 192.168.100.100
    Sep 19 23:44:50 nginx Keepalived[127942]: Stopping
    Sep 19 23:44:50 nginx Keepalived_vrrp[127945]: (VI_1) sent 0 priority
    Sep 19 23:44:50 nginx Keepalived_vrrp[127945]: (VI_1) removing protocol VIPs.
    Sep 19 23:44:50 nginx Keepalived_healthcheckers[127944]: Shutting down service [192.168.33.18]:tcp:3306 from VS [192.168.100.100]:tcp:3306
    Sep 19 23:44:50 nginx Keepalived_healthcheckers[127944]: Stopped
    Sep 19 23:44:50 nginx kernel: IPVS: __ip_vs_del_service: enter
    Sep 19 23:44:51 nginx Keepalived_vrrp[127945]: Stopped
    Sep 19 23:44:51 nginx Keepalived[127942]: Stopped Keepalived v2.0.0 (05/27,2018)
    ^C
    [root@nginx ~]# date
    Fri Sep 20 14:45:06 CST 2019
    [root@nginx ~]# 

    查找原因为:我的date时间是ntp自动同步的,log时间是有rsyslog进程控制的。

    解决:service rsyslog restart 或者 /etc/init.d/rsyslog restart,执行之后时间正常

    [root@nginx ~]# tail -fn 10 /var/log/messages
    Sep 19 23:44:50 nginx Keepalived_vrrp[127945]: (VI_1) removing protocol VIPs.
    Sep 19 23:44:50 nginx Keepalived_healthcheckers[127944]: Shutting down service [192.168.33.18]:tcp:3306 from VS [192.168.100.100]:tcp:3306
    Sep 19 23:44:50 nginx Keepalived_healthcheckers[127944]: Stopped
    Sep 19 23:44:50 nginx kernel: IPVS: __ip_vs_del_service: enter
    Sep 19 23:44:51 nginx Keepalived_vrrp[127945]: Stopped
    Sep 19 23:44:51 nginx Keepalived[127942]: Stopped Keepalived v2.0.0 (05/27,2018)
    Sep 19 23:49:32 nginx kernel: Kernel logging (proc) stopped.
    Sep 19 23:49:32 nginx rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1969" x-info="http://www.rsyslog.com"] exiting on signal 15.
    Sep 20 14:49:32 nginx kernel: imklog 5.8.10, log source = /proc/kmsg started.
    Sep 20 14:49:32 nginx rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="130486" x-info="http://www.rsyslog.com"] start
    ^C
    [root@nginx ~]# date
    Fri Sep 20 14:53:38 CST 2019
    [root@nginx ~]#
  • 相关阅读:
    HDU 1069 Monkey and Banana
    HDU 1029 Ignatius and the Princess IV
    HDU 1024 Max Sum Plus Plus
    Gym100923H Por Costel and the Match
    Codeforces 682C Alyona and the Tree
    Codeforces 449B Jzzhu and Cities
    Codeforces (ccpc-wannafly camp day2) L. Por Costel and the Semipalindromes
    Codeforces 598D (ccpc-wannafly camp day1) Igor In the Museum
    Codeforces 1167c(ccpc wannafly camp day1) News Distribution 并查集模板
    快乐数问题
  • 原文地址:https://www.cnblogs.com/zwj-linux/p/11557240.html
Copyright © 2011-2022 走看看