July 29, 2014

CentOS 6 NTP Server

It is important for systems administrators to make sure that mission-critical servers are always using the correct system time.

The ntpd (Network Time Protocol daemon) program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. Make sure that the time zone configuration of your computer is correct. ntpd itself does not do anything about the time zones, it just uses UTC internally.

Install Network Time Protocol (NTP) daemon

# yum install ntp

Add NTP daemon to startup

# chkconfig ntpd on

Edit the NTPD config file

Here you can either use the default NTP public servers or add servers closer to your region.

Visit http://www.pool.ntp.org/en/ and either considder joining or getting your regional NTP pool servers

# vi /etc/ntp.conf

Start the NTP daemon

# service ntpd start

Standard NTP query program (ntpq)

Print a list of the peers known to the server as well as a summary of their state.

# ntpq -p
remote refid st t when poll reach delay offset jitter
*javanese.kjsl.c 2 u 108 128 377 1.401 3.392 4.779
+66-191-139-149. 2 u 70 128 377 46.044 11.205 5.378
+ntp.sunflower.c 3 u 85 128 377 50.962 -2.129 14.112

Managing NTPd with Puppet

If you’re running Puppet we have included the manifest for installing Varnish on CentOS 6. If you’re not running Puppet then you can install it by following the instructions outlined in our CentOS 6 Puppet Install.

This is only the manifest and doesn’t include any of the files (i.e. ntp.conf).

  • http://www.anacondawebhosting.com/ Hosting Chile

    Good tutorial
    Excellent blog.

  • David Dionne

    Good tutorial, EXCELLENT puppet integration section…but this really onlyl covers an ntp client config, not a server config