CentOS system time zone settings

Source: Internet
Author: User
In some distributed applications, the clock consistency of the system is often required. For example, HBase databases built on Hadoop and cluster applications. The following describes how to set the CentOS (or RedHatLinux) time zone. Check the time zone in Asia.

In some distributed applications, the clock consistency of the system is often required. For example, HBase databases built on Hadoop and cluster applications.

The following describes how to set the CentOS (or Red Hat Linux) time zone.

Check the time zone in Asia.

 

[Plain]View plaincopyprint?
  1. [App @ machine-0 ~] $ Ls/usr/share/zoneinfo/Asia

Display result:

 

[Plain]View plaincopyprint?
  1. Aden Bahrain Chungking Harbin Jerusalem kranoyarsk Muscat Qatar Singapore Ujung_Pandang
  2. Yerevan Almaty Baku Colombo Hebron Kabul Kuala_Lumpur nicsia Qyzylorda Taipei
  3. Ulaanbaatar Amman Bangkok Dacca Ho_Chi_Minh Kamchatka Kuching Novokuznetsk Rangoon
  4. Tashkent Ulan_Bator Anadyr Beirut Damascus Hong_Kong Karachi Kuwait Novosibirsk Riyadh
  5. Tbilisi Urumqi Aqtau Bishkek Dhaka Hovd Kashgar Macao Omsk Saigon Tehran Ust-Nera Aqtobe
  6. Brunei Dili Irkutsk Kathmandu Macau Oral sahalin Tel_Aviv Vientiane Ashgabat Calcutta
  7. Dubai Istanbul Katmandu Magadan Phnom_Penh Samarkand Thimbu implements Vostok Ashkhabad Choibalsan
  8. Dushanbe Jakarta Khandyga Makassar Pontianak Seoul Thimphu Yakutsk Baghdad Chongqing Gaza
  9. Jayapura Kolkata Manila Pyongyang Shanghai Tokyo Yekaterinburg
[Html]View plaincopyprint?
The local machine selects Shanghai as the server's time zone. When ntpd is installed on centOS, ntpd automatically synchronizes the clock during system startup. The time zone setting command is as follows:

 

[Plain]View plaincopyprint?
  1. Sudo cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime


 

Restart the system to update the system clock when CentOS starts the ntpd service. Sometimes, to avoid invalidation after the system is restarted, you can use the following command to write the time to the BIOS.

 

[Plain]View plaincopyprint?
  1. Sudo wclock-w
  2.  

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.