happymaster23 wrote:> Hello everyone,
>
> I have problem with time delaying on my CentOS powered server. I have
> tried to set time in BIOS and in OS (with saving time to BIOS), but
> time still delaying, so after month is about five minutes delayed. In
> past I was using this box with Windows and there wasn?t this time
> problem, but I cant warrant, that there are no hardware issues. So I
> was decided, that easiest way to fix this problem will be setting up
> the NTP. I have found many howtos, but I don?t believe them. So my
> question is: How to clearly set NTP in CentOS 5?
# yum install ntp
then, edit /etc/ntp.conf, and at a minimum specify some ntp servers and
restrict access to localhost...
restrict 127.0.0.1
restrict -6 ::1
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server ntp1.sf-bay.org
server ntp2.sf-bay.org
server reloj.kjsl.com
server ntp1.mainecoon.com
server ntp2.mainecoon.com
server time.berkeley.netdot.net
(note, those are the LOCAL TO ME ntp servers that *I* am using, you
should undoubtedly use others as appropriate, or use the pool servers...
see http://ntp.isc.org/bin/view/Servers/WebHome for guidelines)...
finally...
# chkconfig ntpd on
# service ntpd start
and wait about 20 mins for it to sync up, and verify functionality with
ntptrace...
# ntptrace
localhost.localdomain: stratum 3, offset 0.004351, synch distance
0.088396
zorro.sf-bay.org: stratum 2, offset 0.000543, synch distance 0.044773
clock.via.net: stratum 1, offset 0.000027, synch distance 0.000446,
refid 'GPS'
if your systems clock is particularlly funky, it may be a good idea to
edit, /etc/sysconfig/ntpd and set SYNC_HWCLOCK=yes rather than no.
(this tells it to set your HW CMOS clock when it sets the system clock
during the initial synchronization)