2011年3月28日 星期一

AIX NTP Server設定

1.啟動AIX NTP SERVER:

#smitty

System Management > Processes & Subsystems > Subsystems > List All Subsystems

xntpd顯示為inoperative 未啟動

Subsystem                   Group            PID             Status
IBM.ServiceRM         rsct_rm          6029512      active
IBM.CSMAgentRM   rsct_rm          6226118      active
IBM.DRM                  rsct_rm          6291654      active
lpd                              spooler                               inoperative
rwhod                         tcpip                                   inoperative
xntpd                          tcpip                                   inoperative
#lssrc -ls xntpd0513-036 The request could not be passed to the xntpd subsystem.
Start the subsystem and try your command again.

#ntpq -plocalhost   :  timed out, nothing received
***Request timed out

 #smitty

依序選擇
System Management > Processes & Subsystems > Subsystems > Start a Subsystem

Subsystem Name欄位輸入xntpd,再按下Enter
                                                  Start a Subsystem
Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                                   [Entry Fields]
* Subsystem Name                                     xntpd                                                          +
   Subsystem Parameters                             []

                                                    COMMAND STATUS
Command: OK            stdout: yes           stderr: no
Before command completion, additional instructions may appear below.
0513-059 The xntpd Subsystem has been started. Subsystem PID is 5636272.
2.查詢NTP Server狀態:

依序選擇
System Management > Processes & Subsystems > Subsystems >  Query a Subsystem

Subsystem PROCESS ID欄位輸入Subsystem PID  5636272,再按下Enter

                                                  Query a Subsystem
Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                                     [Entry Fields]
* Subsystem PROCESS ID                           5636272                                                        +


                                                    COMMAND STATUS
Command: OK            stdout: yes           stderr: no
Before command completion, additional instructions may appear below.
[TOP]
Program name:    /usr/sbin/xntpd
Version:         3
Leap indicator:  11 (Leap indicator is insane.)
Sys peer:        no peer, system is insane
Sys stratum:     16
Sys precision:   -17
Debug/Tracing:   DISABLED
Root distance:   0.000000
Root dispersion: 0.000000
Reference ID:    no refid, system is insane
Reference time:  no reftime, system is insane
Broadcast delay: 0.003906 (sec)
Auth delay:      0.000122 (sec)
System flags:    bclient pll monitor filegen
System uptime:   114 (sec)
Clock stability: 0.000000 (sec)
Clock frequency: 0.000000 (sec)
Peer: 192.168.x.xx

     flags: (configured)
     stratum:  4, version: 3

     our mode: client, his mode: server
Peer: 220.130.158.72
     flags: (configured)(preferred)
     stratum:  2, version: 3
     our mode: client, his mode: server
Subsystem         Group            PID             Status
xntpd                 tcpip              5636272      active

[BOTTOM]

因之前已先設定過,所以上方會秀這兩個peer,分別為兩部其他台NTP Server,供此台NTP Server參照時間設定

可更改上層的NTP SERVER為其他台NTP SERVER
原設定:
#more etc/ntp.conf#
broadcastclient
server 220.130.158.72   prefer
server 192.168.x.xx    #dc
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace

修改最下方敘述#refresh -s xntpd
0513-095 The request for subsystem refresh was completed successfully.

#ntpq -p
    remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
220.130.158.72  220.130.158.70   2 u   15   64    1     7.69    0.854 15875.0
220.130.158.71  59.124.196.87    2 u   14   64    1    40.92   18.634 15875.0

#lssrc -ls xntpd
Program name:    xntpd
Version:         3
Leap indicator:  11 (Leap indicator is insane.)
Sys peer:        no peer, system is insane
Sys stratum:     16
Sys precision:   -17
Debug/Tracing:   DISABLED
Root distance:   0.000000
Root dispersion: 0.000000
Reference ID:    no refid, system is insane
Reference time:  no reftime, system is insane
Broadcast delay: 0.003906 (sec)
Auth delay:      0.000122 (sec)
System flags:    bclient pll filegen
System uptime:   48 (sec)
Clock stability: 0.000000 (sec)
Clock frequency: 0.000000 (sec)
Peer: 220.130.158.72
     flags: (configured)
     stratum:  2, version: 3
     our mode: client, his mode: server
Peer: 220.130.158.71
     flags: (configured)(preferred)
     stratum:  2, version: 3
     our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            4653180      active

#date
Mon Mar 28 16:44:53 GMT+08:00 2011


#date
Mon Mar 28 16:48:23 GMT+08:00 2011
#ntpq -p
    remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
+220.130.158.72  220.130.158.70   2 u   14   64   37    10.77    0.247  875.41
*220.130.158.71  59.124.196.87    2 u   13   64   37     9.02    1.792  877.56
#lssrc -ls xntpd
Program name:    xntpd
Version:         3
Leap indicator:  00 (No leap second today.)
Sys peer:        220.130.158.71
Sys stratum:     3
Sys precision:   -17
Debug/Tracing:   DISABLED
Root distance:   0.018539
Root dispersion: 0.915588
Reference ID:    220.130.158.71
Reference time:  d13ac9bd.e135e000  Mon, Mar 28 2011 16:47:57.879
Broadcast delay: 0.003906 (sec)
Auth delay:      0.000122 (sec)
System flags:    bclient pll filegen
System uptime:   276 (sec)
Clock stability: 0.000000 (sec)
Clock frequency: 0.000000 (sec)
Peer: 220.130.158.72
     flags: (configured)(sys peer)
     stratum:  2, version: 3
     our mode: client, his mode: server
Peer: 220.130.158.71
     flags: (configured)(sys peer)(preferred)
     stratum:  2, version: 3
     our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            4653180      active
 在ntp server 下指令#lssrc -ls xntpd
#lssrc -ls xntpd
Program name:    /usr/sbin/xntpd
Version:         3
Leap indicator:  11 (Leap indicator is insane.)
Sys peer:        no peer, system is insane
Sys stratum:     16
Sys precision:   -17
Debug/Tracing:   DISABLED
Root distance:   0.026581
Root dispersion: 4.833160
Reference ID:    220.130.158.72
Reference time:  d13a9ebd.7ec86000  Mon, Mar 28 2011 13:44:29.495
Broadcast delay: 0.003906 (sec)
Auth delay:      0.000122 (sec)
System flags:    bclient pll monitor filegen
System uptime:   411 (sec)
Clock stability: 0.000000 (sec)
Clock frequency: 0.000000 (sec)
Peer: 192.168.3.81
     flags: (configured)
     stratum:  4, version: 3
     our mode: client, his mode: server
Peer: 220.130.158.72
     flags: (configured)(preferred)
     stratum:  2, version: 3
     our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            5636272      active

#ntpq -p
#ntpq -p
    remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
220.130.158.72  220.130.158.70   2 u    3   64    3    10.89    0.876 7875.03
192.168.x.xx    192.168.3.10     4 u    2   64    7     0.38  -23.740 3879.52
#date
Mon Mar 28 14:04:53 GMT+08:00 2011
#date
Mon Mar 28 14:09:09 GMT+08:00 2011
#ntpq -p
    remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
*220.130.158.72  220.130.158.70   2 u   21   64   77    12.77   -3.094  382.25
192.168.x.xx    192.168.3.10     4 u   20   64   77     0.47  -20.754  385.73
#ntpq -p
    remote                   refid                 st t when poll  reach   delay   offset    disp
==============================================================================
*220.130.158.72  220.130.158.70   2 u   37   64    377     8.26   -1.288      3.80
  192.168.x.xx      192.168.3.10       4 u   41   256  377     0.38   -21.469    7.02
#lssrc -ls xntpd
Program name:    /usr/sbin/xntpd
Version:         3
Leap indicator:  00 (No leap second today.)
Sys peer:        220.130.158.72
Sys stratum:     3
Sys precision:   -18
Debug/Tracing:   DISABLED
Root distance:   0.024109
Root dispersion: 0.406464
Reference ID:    220.130.158.72
Reference time:  d13aa481.c3f39000  Mon, Mar 28 2011 14:09:05.765
Broadcast delay: 0.003906 (sec)
Auth delay:      0.000122 (sec)
System flags:    bclient pll monitor filegen
System uptime:   349 (sec)
Clock stability: 16.000000 (sec)
Clock frequency: 128.000000 (sec)
Peer: 192.168.X.XX
     flags: (configured)
     stratum:  4, version: 3
     our mode: client, his mode: server
Peer: 220.130.158.72
     flags: (configured)(sys peer)(preferred)
     stratum:  2, version: 3
     our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            4653104      active

在ntp server 或 Client下指令
#ntptrace Ntp Server IP
#ntptrace  127.0.0.1
loopback: stratum 3, offset 0.000530, synch distance 0.04329
220.130.158.72: stratum 2, offset -0.002762, synch distance 0.03432
220.130.158.70:         *Timeout*
#ntptrace 220.130.158.72
220.130.158.72: stratum 2, offset -0.002178, synch distance 0.03500
220.130.158.70:         *Timeout*
#ntptrace 220.130.158.70
220.130.158.70:         *Timeout*
#ntptrace 192.168.3.81
192.168.3.81: stratum 4, offset -0.022959, synch distance 0.17415
192.168.3.10: stratum 3, offset -0.017178, synch distance 0.10115
59.124.196.85: stratum 2, offset -0.001510, synch distance 0.04126
59.124.196.86: stratum 1, offset 0.039904, synch distance 1.00000, refid 'IRIG'
#vi /etc/ntp.conf
#
broadcastclient
server 220.130.158.72
server 220.130.158.71   prefer
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
尚未生效
#ntpq -p
    remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
*220.130.158.72  220.130.158.70   2 u   27   64   37    10.41   -9.683  876.59
192.168.3.81    192.168.3.10     4 u   27   64   37     0.40  -13.427  879.91
#lssrc -ls xntpd
Program name:    /usr/sbin/xntpd
Version:         3
Leap indicator:  00 (No leap second today.)
Sys peer:        220.130.158.72
Sys stratum:     3
Sys precision:   -17
Debug/Tracing:   DISABLED
Root distance:   0.022629
Root dispersion: 0.405060
Reference ID:    220.130.158.72
Reference time:  d13ac853.fecac000  Mon, Mar 28 2011 16:41:55.995
Broadcast delay: 0.003906 (sec)
Auth delay:      0.000122 (sec)
System flags:    bclient pll monitor filegen
System uptime:   323 (sec)
Clock stability: 8.000000 (sec)
Clock frequency: 64.000000 (sec)
Peer: 192.168.3.81
     flags: (configured)
     stratum:  4, version: 3
     our mode: client, his mode: server
Peer: 220.130.158.72
     flags: (configured)(sys peer)(preferred)
     stratum:  2, version: 3
     our mode: client, his mode: server
Subsystem         Group            PID          Status
xntpd            tcpip            4653180      active
若有修改過ntp.conf,xntpd需重新啟動