DB2 10.5 for Linux, UNIX, and Windows

Setting up a Network Time Protocol server

This topic outlines how to setup a Network Time Protocol (NTP) server to ensure that all servers that the instance runs on have similar time settings. By default, the NTP server is setup by the DB2® installer. During instance creation and update, the NTP is automatically setup on the primary CF. This setup is a best practice that will help with problem diagnosis and informal server monitoring.

Before you begin

In a DB2 pureScale® environment, to synchronize operations and facilitate time sensitive operations, the system clocks of all members must be synchronized.

For this reason, NTP must be setup on all of your members. The DB2 installer installs and sets up the NTP server and clients. By default, the NTP server is the primary CF. You can use the steps in this topic to change that default setting and assign another host to act as the NTP server.

The DB2 database manager checks whether NTP is correctly set up on each member and verifies the presence of the NTP daemon. The DB2 database manager also periodically compares time stamps between members to check that they differ by less than the value set by the MAX_TIME_DIFF database manager configuration parameter.

In a DB2 pureScale environment, the value of MAX_TIME_DIFF represents the maximum number of minutes allowed between the system clocks of two members; the default is 1 minute. For each member, if NTP is not correctly set up or the NTP daemon is not present, or if time stamps between members differ by more than the value of MAX_TIME_DIFF, warnings are written to the db2diag log files.

About this task

If you do not have access to an NTP time server, use the following steps to configure one of the hosts in the cluster or another host accessible by members as an NTP server. The system clock on this host will be used as the clock that is synchronized. This host must remain online to continue synchronizing the clocks on the hosts.

Procedure

  1. Choose the host that you will setup as an NTP server.
  2. Setup the NTP daemon to synchronize to its own system clock. Edit /etc/ntp.conf and add the following lines:
    server 127.127.1.0 prefer # the logical IP address for the NTP server to sync 
    to its own system clock
    fudge 127.127.1.0
    driftfile /etc/ntp.drift
    tracefile /etc/ntp.trace
  3. Configure the NTP server to start at system restart.
    • On AIX® operating systems, edit the file /etc/rc.tcpip and uncomment the following entry:
      start /usr/sbin/xntpd -x "$src_running"
    • On Linux operating systems, run the chkconfig ntp on command.
  4. Start the NTP server:
    • On AIX operating systems, run the startsrc -s xntpd command.
    • On Linux operating systems, run the service ntp start command.