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?
- [App @ machine-0 ~] $ Ls/usr/share/zoneinfo/Asia
Display result:
[Plain]View plaincopyprint?
- Aden Bahrain Chungking Harbin Jerusalem kranoyarsk Muscat Qatar Singapore Ujung_Pandang
- Yerevan Almaty Baku Colombo Hebron Kabul Kuala_Lumpur nicsia Qyzylorda Taipei
- Ulaanbaatar Amman Bangkok Dacca Ho_Chi_Minh Kamchatka Kuching Novokuznetsk Rangoon
- Tashkent Ulan_Bator Anadyr Beirut Damascus Hong_Kong Karachi Kuwait Novosibirsk Riyadh
- Tbilisi Urumqi Aqtau Bishkek Dhaka Hovd Kashgar Macao Omsk Saigon Tehran Ust-Nera Aqtobe
- Brunei Dili Irkutsk Kathmandu Macau Oral sahalin Tel_Aviv Vientiane Ashgabat Calcutta
- Dubai Istanbul Katmandu Magadan Phnom_Penh Samarkand Thimbu implements Vostok Ashkhabad Choibalsan
- Dushanbe Jakarta Khandyga Makassar Pontianak Seoul Thimphu Yakutsk Baghdad Chongqing Gaza
- 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?
- 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?
- Sudo wclock-w
-