Set / Sync NTP / HWClock on Enterprise Linux (RH/OEL)
Another one of my public notes,
#First Configure your ntp servers for the ntp daemon. vim /etc/ntp.conf #Chose the options that are going to work best in your case #We usualy remove the local clock entry and add two new ntp servers #Add your local / remote ntp server like this. #server [server address, either hostname or ip] server 10.0.0.2 #or server hostname.domain.ext #save the settings. #next check if the ntp daemon is started during system startup for all levels #that enable networking (235) chkconfig --list ntpd ntpd 0:off 1:off <strong>2:on 3:on</strong> 4:off <strong>5:on</strong> 6:off #If ness. add the ntpd daemon to the required levels using; chkconfig --level 235 ntpd on #Next sync the system clock with the ntp daemon. BE CAREFULL BEFORE APPYING! #If the NTP servers time is in the PAST, this step might cause problems when forced #Readup on ntp how to solve this situation. (yes there is a way😉 ) ntpdate 10.0.0.2 #You own addres naturally #Next enable the ntp daemon to take over the sync task. service ntpd start #or /etc/init.d/ntpd start #To wrap it all up, its nice to sync the hardware clock as well using this step. hwclock --systohc (read 'System to Hardwareclock') #in case you need to manually set the timezone correctly #You might create the correct link from the #usr/share/zoneinfo/?/? to the /etc/localtime Like this ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime #Hope this helps you as much as it helped me in the past #Check to see if the NTPd is working can be done #using the following command ntpq ntpq>peers
Posted on November 4, 2009, in centreon, Linux, Linux Commands, Network Monitoring, VMWare and tagged /etc/ntp, Daemon, hwclock, NTP, ntp.conf, NTPD, ntpdate, ntpq, ntptime, sync. Bookmark the permalink. 1 Comment.