Setting up NTP to keep server time in sync

Install ntp packages

yum install ntp

Redhat 5 need ntpdate separately

yum install nptdate

Set ntp to start on boot:

chkconfig –level 345 ntp on

chkconfig –level 345 ntpdate on

For redhat 7:

systemctl enable ntpd.service

Verify with this:

chkconfig –list | grep ntp

Should show on for boot levels 3,4,5

chkconfig –list | grep ntp
ntpd            0:off   1:off   2:off   3:on    4:on    5:on    6:off
ntpdate         0:off   1:off   2:off   3:on    4:on    5:on    6:off

Edit the config file if you want to use local server

You can change the servers it uses to sync with to be local domain controllers if you don’t have access to the public NTP servers.

The default settings use round robin pools and send you to random servers in the time server pool.

To change edit the Config File /etc/ntp.conf

Change the server lines:

server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst

Start the service:

systemctl start  ntpd.service

or

service ntpd start

Check it is working:

If it is done right you should be able to see the peers actively being used:

ntpq -p

remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

+tcgalxdc02.colu 10.1.20.4        3 u    –   64  377    0.909   18.481  11.071

*tcghqdc04.colum 128.138.141.172  2 u    7   64  377   25.665   43.190  15.213

If the delay / offset / jitter are zero — it means it is not getting to the server   check the firewall is allowing port 123 traffic for ntp through.

This entry was posted in Uncategorized. Bookmark the permalink.