The time zone in the Linux environment cannot be set (System time is 8 hours slow) problem solving __linux

Source: Internet
Author: User

After a node crashes, after a reboot, observe the spark cluster log and discover that there is a time when the problem cannot be synchronized.


After a careful examination of the system, enter Date-r to find the time zone set to null. The back is directly +0000.


This is definitely not the same, and then enter date-u and date, found two time actually consistent. But it was.


This UTC time is meant to be added to the time zone, so two values are normal when the time zone is not set.


However, according to various methods on the Internet, has not been successful:

Such as

$ sudo cp/usr/share/zoneinfo/asia/shanghai/etc/localtime

or modify/etc/sysconfig/clock and other ways, found that all do not work. Even set the date-s ' XXX ' command, immediately back to the original place.


After a sober analysis, it is found that the time zone setting does not work. It is found that most of these configurations require time to restart in order to take effect.


However, if the cluster continues to run, can the time zone be modified without restarting?


Only to find out in the/etc/profile simply set the

Export tz= ' CST-8 ', the immediate entry into force will be all done.


As the problem took nearly 20 minutes, the solution to the problem was recorded.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.