[Solaris] Cluster NTP 的設定

幫其他國家的 Site 檢查設定時發現居然 server 間時差很嚴重,所以只好先幫他們解決 NTP 不 sync. 的問題。
1. 先從 /etc/inet/ntp.server copy 到 /etc/inet/ntp.conf.cluster 來用,分別在
myklmitv01, myklmitv02都做一樣的動作,把檔案中前面哪一堆有 # 的部分都先殺掉 (佔空間,看著很礙眼).
2. 再編輯一下 by "vi /etc/inet/ntp.conf.cluster".
>> 直接貼下面的設定進去 /etc/inet/ntp.conf.cluster (其中 10.1.110.11 是 NTP server 的 IP address)
server 10.1.110.11
peer clusternode1-priv prefer
peer clusternode2-priv
server 127.127.1.0
fudge 127.127.1.0 stratum 10
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

3. 兩台都改好之後,重起一下 NTP service by "/etc/init.d/xntp.cluster stop; /etc/init.d/xntp.cluster start;"
4. 然後稍待一下檢查 NTP process 及 sync. status by "ps -ef | grep ntp" and "ntpq -p".
5. 附上執行完的結果:

myklmitv01 root#ps -ef | grep ntp
root 1452 1 0 18:18:07 ? 0:00 /usr/lib/inet/xntpd -c /etc/inet/ntp.conf.cluster
root 1458 1 0 18:18:17 ? 0:00 /usr/lib/inet/xntpd
root 2287 28745 0 18:29:31 pts/22 0:00 grep ntp


myklmitv01 root#ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
*10.1.110.11 .GPS. 1 u 9 128 377 27.97 -5.261 27.92
LOCAL(0) LOCAL(0) 10 l 43 64 377 0.00 0.000 10.01
clusternode1-pr 0.0.0.0 16 - - 64 0 0.00 0.000 16000.0
+clusternode2-pr 10.1.110.11 2 u 23 64 176 -4.67 20.924 390.00


myklmitv02 root#ps -ef | grep ntp
root 5439 1 0 18:20:02 ? 0:00 /usr/lib/inet/xntpd
root 6092 5346 0 18:30:12 pts/16 0:00 grep ntp
root 5433 1 0 18:20:02 ? 0:00 /usr/lib/inet/xntpd -c /etc/inet/ntp.conf.cluster


myklmitv02 root#ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
*10.1.110.11 .GPS. 1 u 15 64 377 42.54 19.533 22.26
LOCAL(0) LOCAL(0) 10 l 14 64 377 0.00 0.000 10.01
+clusternode1-pr 10.1.110.11 2 u 34 64 377 0.78 3.101 11.80
clusternode2-pr 0.0.0.0 16 - - 64 0 0.00 0.000 16000.0

0 Responses