Subsections


8.4 Managing NTP for the OSCAR Server and Clients

NTP is the Network Time Protocol which is used to synchronize the computer clock to external sources of time. The ntpd daemon can operate as a client (by connecting to other NTP servers to get the current time) and as a server (by providing the current time to other NTP clients).


OSCAR uses NTP to synchronize:

For the OSCAR server, NTP is configured to contact several public NTP servers for time synchronization. If none of these external servers can be contacted (because the server is not connected to the internet for example), it will still be used by the OSCAR clients as a source for the current time. Thus, your OSCAR cluster will be locally synchronized even if it is not in-sync with the rest of the world.

For each OSCAR client, NTP is configured to contact only the OSCAR server. If you want to have your clients connect to other public NTP servers, you will have to edit the NTP configuration files.

8.4.1 Configuring NTP

By default, the OSCAR server is set up to use several public NTP servers for its time source, and the OSCAR clients are set up to use the OSCAR server for their time sources. If you want to change the servers used for time synchronization, you will need to edit two configuration files: /etc/ntp.conf and /etc/ntp/step-tickers.

For the /etc/ntp.conf file, place entries of the form `` server SERVER_NAME_OR_IP'' at the top of the file, one entry per line. You can have as many server lines as you want. However, ALL of the listed servers are consulted for time synchronization, so you may want to limit the number of servers to three or less. Here is an example of the first few lines of a typical /etc/ntp.conf file:

     # These are some servers for use by the ntpd daemon.
     server 130.126.24.24
     server ntp0.cornell.edu
     server ntp.cmr.gov

Notice that you may use either FQDNs (fully qualified domain names) or IP addresses. Most NTP servers prefer that you use FQDNs in case they change the server IP address, but typically these IP addresses are fairly static.

For the /etc/ntp/step-tickers file, place these NTP servers on a single line separated by spaces. Here is an example of the /etc/ntp/step-tickers file using the same servers:

     130.126.24.24 ntp0.cornell.edu ntp.cmr.gov

The servers used in the /etc/ntp.conf file and the /etc/ntp/step-tickers file do not have to be the same. The /etc/ntp/step-tickers file is used to force the clock to be set correctly at boot time, while the /etc/ntp.conf file is used to adjust the clock in small increments while the system is running.

8.4.2 Enabling/Disabling the NTP Service

By default, the ntpd daemon is configured to start at boot time in run levels 2 through 5. If for some reason you want to disable NTP without actually uninstalling it, execute the following commands:

 # /sbin/service ntpd stop
 # /sbin/chkconfig --level 2345 ntpd off

This will not only stop any currently running ntpd daemon, but also prevent NTP from starting up at boot time.


NOTE: You must be root to execute these commands.


To restart NTP and make NTP start up at boot time, execute the following commands:

 # /sbin/service ntpd restart
 # /sbin/chkconfig --level 2345 ntpd on

For more information on NTP, see the (rather lengthy) documentation at http://www.ntp.org/.

root 2002-11-08