Home > Articles > Operating Systems, Server > Solaris

  • Print
  • + Share This
Like this article? We recommend

Configuring NTP

To set up the SCs and domains as NTP clients, edit the ntp.conf file. The xntpd(1M) daemon reads the ntp.conf file at startup time. The configuration must contain a minimum of three time servers (with independent time sources), as recommended by the NTP protocol designers.

Using a text editor, edit the ntp.conf file by inserting the following lines for the main SC, the spare SC, and the bootable domains. Be sure to add the prefer argument to the host that is preferred for synchronization.

# /etc/inet/ntp.conf
server NTP_Server1 prefer
server NTP_Server2
server NTP_Server3

The drift file should also be added to record the frequency offset of the local clock oscillator. The drift file is read at startup to set the initial frequency offset. Add the following line to the ntp.conf file:

driftfile /var/ntp/ntp.drift

Statistics and file generation should also be used. Be sure to indicate the directory path where statistics files should be created. In the following example, peerstats are generated to record peer statistics, and loopstats are generated to record loop filter statistics. Finally, clockstats are generated to record clock driver statistics.

To set up statistics and file generation, add the following lines to the ntp.conf file:

statsdir /var/ntp/ntpstats
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable

NOTE

You should set up a cron(1M) job to remove the existing statistics files on a regular basis.

The following is a full example of an ntp.conf file:

# /etc/inet/ntp.conf
server clock.via.net prefer
server navobs1.usnogps.navy.mil
server ntp.ucsd.edu
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable

After you have edited the ntp.conf file, you must stop and restart the NTP daemon, as in the following example:

sc:# /etc/init.d/xntpd stop
sc:# /etc/init.d/xntpd start

NOTE

NTP is an insecure protocol. If you are running a secure environment, you should take additional steps to implement the appropriate level of security. Refer to the Sun BluePrints™ articles cited in the "References" section.

  • + Share This
  • 🔖 Save To Your Account