Linux clock and hardware clock are inconsistent

Source: Internet
Author: User
When copying a DB2 cluster, the two hosts are required to have the same time. However, the system time on a host is about 12 hours different from the hardware Time. After Manual synchronization, the restart time is about 12 hours different. Why is it like this? first introduce the difference between the system clock and the hardware clock: Linux...

When copying a DB2 cluster, the two hosts are required to have the same time.
However, the system time on a host is about 12 hours different from the hardware Time. After Manual synchronization, the restart time is about 12 hours different.
Why is it like this? first introduce the differences between the system clock and the hardware clock:
Linux Clock is divided into System Clock and Real Time Clock (RTC. The system clock is the current Linux Kernel clock, and the hardware clock is the battery-powered clock on the motherboard. This hardware clock can be set in the BIOS. When Linux is started, the hardware clock reads the system clock settings, and then the system clock runs independently of the hardware.
Query time
Swas702 :~ # Date

Fri Mar 9 13:33:15 CST 2011

Swas702 :~ # Hwclock -- show

Fri Mar 9 13:33:22 2011-0.517526 seconds
Set system time
Was7:/ccc # date

Fri Mar 9 14:02:35 CST 2011

Was7:/ccc # date-s "14:02:35"

Fri Mar 9 14:02:35 CST 2011

Was7:/ccc # date

Fri Mar 9 14:02:36 CST 2011
Set hardware Time
Swas702 :~ # Hwclock -- set -- date = "13:33:22"
Swas702 :~ # Hwclock -- show

Fri Mar 9 13:33:22 2011-0.517526 seconds
If you want to synchronize the system time with the hardware clock, use
Swas702 :~ # Hwclock -- hctosys (hc indicates the hardware Time, sys indicates the system time)
Swas702 :~ # Clock -- systohc system clock and hardware clock synchronization


From Dream19881003

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.