To ensure that your system is always using the correct time, you can sync the hardware clock with a remote time server. This can be done in CentOS by using the
NTP service which is not installed by default.
Install NTP service
[root@glt ~]# yum install ntp
Turn on service
[root@glt ~]# chkconfig ntpd on
Synchronize with time server in your zone
Continental Zones |
URL |
Europe
|
europe.pool.ntp.org
|
Asia
|
asia.pool.ntp.org
|
Oceania
|
oceania.pool.ntp.org
|
North America
|
north-america.pool.ntp.org
|
South America
|
south-america.pool.ntp.org
|
Africa
|
africa.pool.ntp.org
|
[root@glt ntp]# ntpdate north-america.pool.ntp.org
1 Oct 22:30:26 ntpdate[14429]: adjust time server 72.14.183.239 offset 0.011128 sec
Start the NTP service
[root@glt ~]# /etc/init.d/ntpd start
Verify that the NTP service is working
[root@glt ntp]# ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
+198.58.100.237 127.67.113.92 2 u 40 64 1 58.513 -0.780 0.002
+151.236.20.4 193.190.230.65 2 u 39 64 1 260.159 5.373 0.002
*66.175.216.101 127.67.113.92 2 u 38 64 1 81.630 -5.700 0.002