故障现象

  1. 系统日志时间晚了整整8个小时,比如现在是中午12点,日志时间为凌晨4点
  2. date命令报错(Local time zone must be set--see zic manual page)

解决方案(失败)

  1. 修改/etc/profile

    export TZ='Asia/Shanghai'

    无效,date命令显示正常,但是放在脚本中的date命令依然报错,并且日志时间依然延后8小时

  2. tzselect配置
    #tzselect
    Please identify a location so that time zone rules can be set correctly.
    Please select a continent or ocean.
    ) Africa
    ) Americas
    ) Antarctica
    ) Arctic Ocean
    ) Asia
    ) Atlantic Ocean
    ) Australia
    ) Europe
    ) Indian Ocean
    ) Pacific Ocean
    ) none - I want to specify the time zone using the Posix TZ format.
    #?
    Please select a country.
    ) Afghanistan ) Israel ) Palestine
    ) Armenia ) Japan ) Philippines
    ) Azerbaijan ) Jordan ) Qatar
    ) Bahrain ) Kazakhstan ) Russia
    ) Bangladesh ) Korea (North) ) Saudi Arabia
    ) Bhutan ) Korea (South) ) Singapore
    ) Brunei ) Kuwait ) Sri Lanka
    ) Cambodia ) Kyrgyzstan ) Syria
    ) China ) Laos ) Taiwan
    ) Cyprus ) Lebanon ) Tajikistan
    ) East Timor ) Macau ) Thailand
    ) Georgia ) Malaysia ) Turkmenistan
    ) Hong Kong ) Mongolia ) United Arab Emirates
    ) India ) Myanmar (Burma) ) Uzbekistan
    ) Indonesia ) Nepal ) Vietnam
    ) Iran ) Oman ) Yemen
    ) Iraq ) Pakistan
    #?
    Please select one of the following time zone regions.
    ) Beijing Time
    ) Xinjiang Time
    #? The following information has been given: China
    Beijing Time Therefore TZ='Asia/Shanghai' will be used.
    Local time is now: Wed Nov :: CST .
    Universal Time is now: Wed Nov :: UTC .
    Is the above information OK?
    ) Yes
    ) No
    #? You can make this change permanent for yourself by appending the line
    TZ='Asia/Shanghai'; export TZ
    to the file '.profile' in your home directory; then log out and log in again. Here is that TZ value again, this time on standard output so that you
    can use the /usr/bin/tzselect command in shell scripts:
    Asia/Shanghai
    [root@compute--: 2019年 11月 27日 星期三 :: Local time zone must be set--see zic manual page /root ]
    #date
    2019年 11月 27日 星期三 :: Local time zone must be set--see zic manual page

    无效

  3. /etc/localtime
    rm -f /etc/localtime
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

    依然没有什么鸟用

最后网上看了一篇文章大概是说可能是升级libc.so.6导致,尝试以下方法总算成功了

解决方案(成功!)

#ll /usr/local/glibc-2.14/etc/
总用量
-rw-r--r-- root root 7月 : ld.so.cache
lrwxrwxrwx root root 7月 : localtime -> ../share/zoneinfo/Factory
-rw-r--r-- root root 7月 : rpc #cd /usr/local/glibc-2.14/etc/ #rm localtime
rm:是否删除符号链接 "localtime"?y #ln -s /usr/local/glibc-2.14/share/zoneinfo/Asia/Shanghai localtime

解决无法修改日志时间的问题(Local time zone must be set--see zic manual page 2019 )的更多相关文章

  1. 时区提示:Local time zone must be set--see zic manual page 2018的解决办法

    问题描述:在centos服务器上执行date命令时,显示的时间信息中的时区不正常,如下: [root@ulocalhost ~]# date Mon Apr 9 02:57:38 Local time ...

  2. Websphere设置JVM时区解决程序、日志时间快8小时问题

    原文链接:http://www.itpub.net/thread-1204714-1-1.html 相信很多使用Websphere的朋友会经常在Windows操作系统中遇到程序时间快8小时的问题 如果 ...

  3. 查看linux系统,服务,配置文件被修改的时间

    如何查看服务启动时间 [root@qike /]# ps -ef |grep nginx root 14730 1 0 16:45 ? 00:00:00 nginx: master process / ...

  4. springboot动态修改日志级别+权限认证

    1. springboot动态修改日志级别+权限认证 1.1. 需求 网上找到的动态修改日志级别的方式,基本都是没有权限验证的,或者特地关闭权限验证,但也没给出加上验证的解决方式 修改日志等级也是一个 ...

  5. 解决vsftpd日志时间问题

    解决vsftpd日志时间问题 发布时间:August 29, 2008 分类:Linux <你必须承认土也是一种艺术> <Linux下查看Apache的请求数> 最近发现vsf ...

  6. 解决Flink输出日志中时间比当前时间晚8个小时的问题

    Flink安装在CentOS7上,默认时间是UTC时间,查看Flink日志,发现输出时间比当前时间晚8个小时. 通过如下命令,调整成北京时间 cp /usr/share/zoneinfo/Asia/S ...

  7. Tomcat 修改日志输出配置 定期删除日志

    tomcat的下的日志catalina.out 和 qc.log疯狂增长,以下是解决办法 我生产环境tomcat版本 Server version: Apache Tomcat/7.0.35 Serv ...

  8. 修改主机时间对MySQL影响

    背景 在装机实施时,BIOS忘记调整时间,导致服务器时间与CST不符合:待发现问题时,MySQL环境已经在运行,所以只能通过操作系统进行更改:但是更改完成后,MySQL进行重启时发生了问题.以下为问题 ...

  9. Linux服务器修改时区时间

    时间的一致性很关键,对于日志的分析和程序的对接都至关重要! 01.tzselect 修改时区 可以使用命令 tzselect,修改时区.操作示例: $ tzselect Please identify ...

随机推荐

  1. LightOJ 1229 Tablecross

    Treblecross is a two player game where the goal is to get three X in a row on a one-dimensional boar ...

  2. 洛谷 题解 P1351 【联合权值】

    Problem P1351 [联合权值] record 用时: 99ms 空间: 13068KB(12.76MB) 代码长度: 3.96KB 提交记录: R9883701 注: 使用了 o1 优化 o ...

  3. socket AcceptAsync方法的使用

    AcceptAsync与Accept很大的不一样 Accept是一个同步 阻塞的已经封装好底层的方法 AcceptAsync是一个异步 非阻塞未封装的底层连接入口,需要手动填入连接代码用于优化sock ...

  4. 纯净版SSM

    pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w ...

  5. 【hibernate】存储图片

    [hibernate]存储图片 转载: package cn.ycx.study.hibernate.entity; import javax.persistence.Entity; import j ...

  6. Java读取Properties文件 Java加载配置Properties文件

    static{ Properties prop = new Properties(); prop.load(Thread.currentThread().getContextClassLoader() ...

  7. vue bus.js 使用方法

    1 ,新建bus.js 内容如下 2,bus.$emit 绑定数据 bus.$emit('tags', this.tagsList); 第一个参数为定义的变量,第二个为集合数据 3, 监听数据 bus ...

  8. Python面向对象-访问权限public和private

    上一节我们介绍了,Class内部可以有属性和方法,外部代码通过直接调用实例的方法来操作数据,这样就可以隐藏内部的逻辑实现:同时,外部代码还是可以自由的修改实例的属性和增加方法. 但是有时候,我们不想这 ...

  9. Geoserver设置style

    1 背景 我们在ArcMap中可以直接通过symbol功能对图层进行定制化配图.但是,如果我们将配好图的shp图层在GeoServer中发布时,会发现图层样式完全丢失了.其实原因很简单,用ArcMap ...

  10. bbbbbb

    Blazor 机制初探以及什么是前后端分离,还不赶紧上车? 标签: Blazor .Net 上一篇文章我发了一个 BlazAdmin 的尝鲜版,这一次主要聊聊 Blazor 是如何做到用 C# 来写前 ...