How To
Summary
This document describes how to correctly configure the Network Time Protocol (NTP) implementation in an AIX environment and how to resolve basic known issues.
Objective
Steps
root@pascal# lssrc -s xntpd
Subsystem Group PID Status
xntpd tcpip inoperative
root@pascal# ntpdate -q descartes
server 9.138.236.8, stratum 3, offset 60.999329, delay 0.02573
29 May 00:38:20 ntpdate[4981126]: step time server 9.138.236.8 offset 60.999329
root@pascal# ntpdate descartes
29 May 00:39:44 ntpdate[4981128]: step time server 9.138.236.8 offset 60.999368
The default configuration looks this way:
broadcastclient
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
We can comment option "broadcastclient" in case we do not want to use the broadcast option on NTP server.
Also, we can add a line "server <hostname or IP address>" with priority for the server that we chose as preferred. So the whole configuration might look like this with multiple servers
# broadcastclient
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
server server1.domain.com prefer
server server2.domain.com
server 192.168.88.1
Files ntp.drift and ntp.trace do not need to exist (they are created during the first start of xntpd daemon). In case you accidentally delete ntp.conf you can find the generic configuration file at this location:
root@pascal# ls -la /usr/lpp/bos.net/inst_root/etc/ntp.conf
-rw-rw-r-- 1 root system 993 Sep 17 2014 /usr/lpp/bos.net/inst_root/etc/ntp.conf
root@pascal# chrctcp -S -a xntpd
0513-059 The xntpd Subsystem has been started. Subsystem PID is 11534750.
root@pascal# chrctcp -S -d xntpd
0513-044 The /usr/sbin/xntpd Subsystem was requested to stop.
root@pascal# startsrc -s xntpd
0513-059 The xntpd Subsystem has been started. Subsystem PID is 9240866.
root@pascal# stopsrc -s xntpd
0513-044 The /usr/sbin/xntpd Subsystem was requested to stop.
root@pascal# refresh -s xntpd
0513-095 The request for subsystem refresh was completed successfully.
root@pascal# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
*ntp.nic.cz .GPS. 1 u 163 256 377 40.07 -0.574 4.14
+tik.cesnet.cz tak.cesnet.cz 2 u 138 256 377 48.36 1.429 3.40
+time3.google.co .GOOG. 1 u 144 256 377 35.08 -0.300 0.67
nim:/root# lssrc -ls xntpd
Program name: xntpd
Version: 3
Leap indicator: 00 (No leap second today.)
Sys peer: ntp.nic.cz
Sys stratum: 2
Sys precision: -16
Debug/Tracing: DISABLED
Root distance: 0.040192
Root dispersion: 0.011749
Reference ID: 217.31.202.100
Reference time: e09845b2.738db000 Wed, May 29 2019 1:41:38.451
Broadcast delay: 0.003906 (sec)
Auth delay: 0.000122 (sec)
System flags: bclient pll filegen
System uptime: 26680 (sec)
Clock stability: 0.007950 (sec)
Clock frequency: 0.000000 (sec)
Peer: time3.google.com
flags: (configured)(sys peer)
stratum: 1, version: 3
our mode: client, his mode: server
Peer: ntp.nic.cz
flags: (configured)(sys peer)
stratum: 1, version: 3
our mode: client, his mode: server
Peer: tik.cesnet.cz
flags: (configured)(sys peer)
stratum: 2, version: 3
our mode: client, his mode: server
Subsystem Group PID Status
xntpd tcpip 7667850 active
a) Directly from xntpd to the file
logconfig =syncevents +peerevents +sysevents +allclock
logfile /var/log/ntp.log
b) Directly to the syslog according to facility:
logconfig =all
daemon.debug /var/log/syslog.log
stopsrc -s syslogd
startsrc -s syslogd
a) Slew issue
Slew mode is used to avoid any unwanted time jumps - especially for a Cluster or DB environment. If you care about preventing time from stepping backward only, then use the "-x" flag. This scenario is the most common.
chssys -s xntpd -a "-x"
If you want to always slew the clock, then use "slewalways yes". Add the following line into the /etc/ntp.conf:
slewalways yes
b) Time goes insane
Sys peer: no peer, system is insane
remote refid st t when poll reach delay offset disp
==============================================================================
ntp.nic.cz .GPS. 1 u 64 64 17 40.05 -359956 1875.03
tik.cesnet.cz tak.cesnet.cz 2 u 63 64 17 40.94 -359956 1875.05
time1.google.co .GOOG. 1 u 62 64 17 30.26 -359956 1875.06
Stop manually xntpd
stopsrc -s xntpd
root@pascal# ntpdate tik.cesnet.cz
30 May 00:36:53 ntpdate[7667882]: step time server 195.113.144.201 offset -3599.562547
startsrc -s xntpd
c) Cannot start xntpd (stays in inoperative mode)
hosts=local, bind4
d) NTP clients report "Synchronization Lost"
Additional Information
SUPPORT |
---|
If you require more assistance, use the following step-by-step instructions to contact IBM to open a case for software with an active and valid support contract. 1. Document (or collect screen captures of) all symptoms, errors, and messages related to your issue. 2. Capture any logs or data relevant to the situation. 3. Contact IBM to open a case: -For electronic support, see the IBM Support Community: 4. Provide a clear, concise description of the issue. - For more information, see: Working with IBM AIX Support: Describing the problem. 5. If the system is accessible, collect a system snap, and upload all of the details and data for your case. - For more information, see: Working with IBM AIX Support: Collecting snap data |
Related Information
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
09 August 2022
UID
ibm10885931