簡介
本檔案介紹適用於Cisco Unified Communications Manager(CUCM)的網路時間通訊協定(NTP)。
必要條件
需求
本文件沒有特定需求。
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
功能的用途
本文檔介紹使用CUCM進行NTP的用途、NTP的配置、收集哪些資料以進行故障排除、資料示例分析以及進行其他研究的相關資源。
使用CUCM的NTP旨在確保伺服器知道正確的時間。CUCM伺服器中的時間非常重要,因為網際網路語音協定(VOIP)對時間變化非常敏感。
CUCM群集必須保持時間同步,該時間同步必須緊鄰群集中的其他伺服器,這是因為資料庫複製要求。
最後,故障排除時間非常重要,因為您希望日誌具有正確的時間戳。
設定
CUCM不支援Windows NTP伺服器;但是,其他型別(如Linux NTP源、Cisco IOS® NTP源和Nexus OS NTP源)是可接受的。
雖然其他思科解決方案可以將Windows伺服器用於NTP解決方案,但是Call Manager、Cisco Unity和即時消息和線上狀態等統一通訊解決方案無法使用,因此需要基於Linux或基於Cisco IOS®的NTP解決方案。
這是因為Windows Time Services經常使用SNTP,而Linux系統很難與其同步。
網路圖表
CUCM發佈伺服器需要不是CUCM群整合員的NTP源;因此,CUCM發佈伺服器將其時間與NTP伺服器同步。在此交換中,CUCM發佈方是NTP客戶端。
CUCM訂閱者將其時間與CUCM發佈者同步。在此交換中,CUCM發佈伺服器是NTP伺服器,其中CUCM訂閱伺服器是NTP客戶端。
注意:請注意,思科即時消息和線上狀態(IM&P)伺服器也被認為是CUCM群集的使用者,因此,它們也依賴CUCM NTP。換句話說,如果NTP在IM&P伺服器上不同步,則會導致系統中的資料庫複製和高可用性問題。
安裝過程
安裝CUCM後,系統會提示確定伺服器是否為群集中的第一個節點。
如果該伺服器不是群集中的第一個節點,則安裝嚮導將移過NTP配置階段;但是,如果是NTP伺服器群集中的第一個節點,則系統會提示您輸入NTP伺服器。
安裝後,使用OS Admin網頁
安裝後,使用命令列介面
如圖所示,您可以找到用於訪問和修改CUCM伺服器中的NTP伺服器的命令。
- 命令utils ntp server list顯示系統上配置的NTP伺服器。
- 該命令utils ntp server add ntp_address adds a new NTP server to the system。
注意:請記住,如果要新增新的NTP伺服器,CUCM伺服器會在新增伺服器之前測試可訪問性;如果伺服器失敗,則會出現下一個錯誤。
- utils ntp server delete命令允許您刪除系統中已配置的任何NTP。
疑難排解
要收集的資料
在對NTP問題進行故障排除時,您需要從出現以下NTP問題的CUCM伺服器收集此資料:
- 該命令的輸出會使用diagnose test。
- 該命令的輸出使用ntp status。
- 從思科即時監控工具(RTMT)收集的CUCM的NTP日誌。
範例分析
例如,已使用CUCM發佈器和NTP中的下一個資訊:
CUCM發佈伺服器
版本:11.5(1)SU5
FQDN: cucm-115.home.lab
IP地址以192.X.X.X開頭
NTP
從Google NTP伺服器
FQDN:time1.example.com.ntp
IP地址以216.X.X.X開頭
CUCM的PCAP稽核 — 無檔案
請注意,埠號為123。這是NTP的埠。在文本框中的命令輸出中,您可以看到NTP版本為4,如NTPv4中所述。您還可以注意到publisher,它在與time1.example.com建立通訊時充當客戶端;但是,它在與cucm-sub1、cucm-sub2和cucm-sub3建立通訊時充當伺服器。
From the CLI of the publisher run the command "utils network capture port 123"
Wait until you see traffic (this can take a little time, or it may be instant) then hit
ctrl+c. Look in the traffic to find where your publisher is communicating with its NTP
server and the NTP server is communication with the publisher (if the NTP server isn't
replying then it is an issue in the network or with the NTP server). The primary focus of
this output is the NTP version. In CUCM 9 and later NTP version 3 (NTPv3) can cause issues
and an NTP source using NTPv4 should be the NTP server for the publisher.
admin:utils network capture size all count 10000000 port 123
Executing command with options:
size=128 count=1000 interface=eth0
src=dest= port=123
ip=
16:08:43.199710 IP cucm-sub3.home.lab.39417 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:08:43.199737 IP cucm-115.home.lab.ntp > cucm-sub3.home.lab.39417: NTPv4, Server, length 48
16:08:43.199823 IP cucm-sub3.home.lab.39417 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:08:43.199859 IP cucm-115.home.lab.ntp > cucm-sub3.home.lab.39417: NTPv4, Server, length 48
16:09:01.640980 IP cucm-115.home.lab.50141 > time1.example.com.ntp: NTPv4, Client, length 48
16:09:01.654675 IP time1.example.com.ntp > cucm-115.home.lab.50141: NTPv4, Server, length 48
16:09:01.654733 IP cucm-115.home.lab.50141 > time1.example.com.ntp: NTPv4, Client, length 48
16:09:01.667368 IP time1.example.com.ntp > cucm-115.home.lab.50141: NTPv4, Server, length 48
16:09:01.668612 IP cucm-115.home.lab.50141 > time1.example.com.ntp: NTPv4, Client, length 48
16:09:01.681366 IP time1.example.com.ntp > cucm-115.home.lab.50141: NTPv4, Server, length 48
16:09:01.681518 IP cucm-115.home.lab.50141 > time1.google.com.ntp: NTPv4, Client, length 48
16:09:01.694108 IP time1.google.com.ntp > cucm-115.home.lab.50141: NTPv4, Server, length 48
16:09:01.875016 IP cucm-115.home.lab.48422 > time1.google.com.ntp: NTPv4, Client, length 48
16:09:01.884476 IP cucm-sub3.home.lab.58072 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:01.884568 IP cucm-115.home.lab.ntp > cucm-sub3.home.lab.58072: NTPv4, Server, length 48
16:09:01.884954 IP cucm-sub3.home.lab.58072 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:01.884999 IP cucm-115.home.lab.ntp > cucm-sub3.home.lab.58072: NTPv4, Server, length 48
16:09:01.885381 IP cucm-sub3.home.lab.58072 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:01.885423 IP cucm-115.home.lab.ntp > cucm-sub3.home.lab.58072: NTPv4, Server, length 48
16:09:01.886147 IP cucm-sub3.home.lab.58072 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:01.886184 IP cucm-115.home.lab.ntp > cucm-sub3.home.lab.58072: NTPv4, Server, length 48
16:09:01.888555 IP time1.google.com.ntp > cucm-115.home.lab.48422: NTPv4, Server, length 48
16:09:01.888642 IP cucm-115.home.lab.48422 > time1.google.com.ntp: NTPv4, Client, length 48
16:09:01.900926 IP time1.google.com.ntp > cucm-115.home.lab.48422: NTPv4, Server, length 48
16:09:01.901017 IP cucm-115.home.lab.48422 > time1.google.com.ntp: NTPv4, Client, length 48
16:09:01.913497 IP time1.google.com.ntp > cucm-115.home.lab.48422: NTPv4, Server, length 48
16:09:01.913566 IP cucm-115.home.lab.48422 > time1.google.com.ntp: NTPv4, Client, length 48
16:09:01.926693 IP time1.google.com.ntp > cucm-115.home.lab.48422: NTPv4, Server, length 48
16:09:02.038981 IP cucm-sub2.home.lab.42078 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.039117 IP cucm-115.home.lab.ntp > cucm-sub2.home.lab.42078: NTPv4, Server, length 48
16:09:02.039281 IP cucm-sub2.home.lab.42078 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.039345 IP cucm-115.home.lab.ntp > cucm-sub2.home.lab.42078: NTPv4, Server, length 48
16:09:02.039434 IP cucm-sub2.home.lab.42078 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.039535 IP cucm-115.home.lab.ntp > cucm-sub2.home.lab.42078: NTPv4, Server, length 48
16:09:02.039607 IP cucm-sub2.home.lab.42078 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.039814 IP cucm-115.home.lab.ntp > cucm-sub2.home.lab.42078: NTPv4, Server, length 48
16:09:02.066544 IP cucm-sub1.home.lab.46400 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.066622 IP cucm-115.home.lab.ntp > cucm-sub1.home.lab.46400: NTPv4, Server, length 48
16:09:02.066751 IP cucm-sub1.home.lab.46400 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.066892 IP cucm-115.home.lab.ntp > cucm-sub1.home.lab.46400: NTPv4, Server, length 48
16:09:02.066968 IP cucm-sub1.home.lab.46400 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.067104 IP cucm-115.home.lab.ntp > cucm-sub1.home.lab.46400: NTPv4, Server, length 48
16:09:02.067155 IP cucm-sub1.home.lab.46400 > cucm-115.home.lab.ntp: NTPv4, Client, length 48
16:09:02.067189 IP cucm-115.home.lab.ntp > cucm-sub1.home.lab.46400: NTPv4, Server, length 48
CUCM的PCAP審查 — 包含檔案
用於解決資料包捕獲中的NTP問題的過濾器為:udp.port == 123。使用該過濾器,您可以看到CUCM發佈者與Google NTP伺服器建立了通訊,並且CUCM發佈者也與CUCM訂閱者進行了通訊。
CUCM的CLI輸出檢視
utils ntp status輸出
NOTE: All nodes will show the current time in UTC regardless of the time zone of the server
(listed in UTC time). This makes it easy to compare times on the different CUCM nodes.
NOTE: If there is a time difference of 15 minutes or more, it is expected that DB replication
will be broken
1) If the publisher is ahead by 15 minutes, this can result in the pub send data to the
sub and the sub would have a delay to process the data because it has not yet reached the time
in the timestamp of the packets from the publisher (this is expected behavior in this type of situation)
2) If the subscriber is ahead by 15 minutes, this would result in the subscriber drop
the data from the publisher because the subscriber sees it as old data (15 minutes old)
admin:utils ntp status
ntpd (pid 28435) is running...
remote refid st t when poll reach delay offset jitter
==============================================================================
203.0.113.0 .GOOG. 1 u 44 64 3 11.724 -0.021 0.064
unsynchronised
polling server every 8 s
Current time in UTC is : Fri Sep 6 20:54:50 UTC 2019
Current time in America/New_York is : Fri Sep 6 16:54:50 EDT 2019
admin:
閱讀下一資訊,如前一個輸出詳解所示。
The very first column contains the "tally code" character. Short overview:
* the source you are synchronized to (syspeer)
# source selected, distance exceeds maximum value
o the PPS(Pulse Per Second) source if your ntpd (ppspeer, only if you have a PPS capable system and refclock)
+ candidate, i.e. it is considered a good source
- outlyer, i.e. quality is not good enough
x falseticker, i.e. this one is considered to distribute bad time
blank: source discarded, failed sanity
See the Select field of the Peer status word on the NTP Event Messages and
Status Words page for more information on the tally codes.
remote
the hostname or IP of the remote machine.
refid
the identification of the time source to which the remote machines is synced.
May be (for example) a radio clock or another ntp server)
st
the stratum of the remote machine. 16 is "unsynchronized". 0 is the best
value, that could be (for example) a radio clock or the ntp servers private
caesium clock (see http://www.eecis.udel.edu/~mills/ntp/html/index.html#intro
for more information about ntp in general).
t
types available:
l = local (such as a GPS, WWVB)
u = unicast (most common)
m = multicast
b = broadcast
- = netaddr
when
how many seconds since the last poll of the remote machine.
poll
the polling interval in seconds.
reach
an 8-bit left-rotating register. Any 1 bit means that a "time packet" was
received. The right most bit indicate the status of the last connection
with the NTP server. It is Octal number. Use calculator in progammer
interface to translate from OCT to BIN: For example 377 translates to
11111111. Each 1 means a successful connection to the NTP server. If you
just start a NTP service, and it connects successfully with its server, this
number will change as follows (if connectivity is good):
00000001 = 001
00000011 = 003
00000111 = 007
00001111 = 017
00011111 = 037
00111111 = 077
01111111 = 177
11111111 = 377
delay
the time delay (in milliseconds) to communicate with the remote.
offset
the offset (in milliseconds) between our time and that of the remote.
jitter
the observed jitter (in milliseconds) of time with the remote.
實用程式診斷測試輸出
admin:utils diagnose test
Log file: platform/log/diag1.log
Starting diagnostic test(s)
===========================
test - disk_space : Passed (available: 6463 MB, used: 12681 MB)
skip - disk_files : This module must be run directly and off hours
test - service_manager : Passed
test - tomcat : Passed
test - tomcat_deadlocks : Passed
test - tomcat_keystore : Passed
test - tomcat_connectors : Passed
test - tomcat_threads : Passed
test - tomcat_memory : Passed
test - tomcat_sessions : Passed
skip - tomcat_heapdump : This module must be run directly and off hours
test - validate_network : Passed
test - raid : Passed
test - system_info : Passed (Collected system information in diagnostic log)
test - ntp_reachability : Passed
test - ntp_clock_drift : Passed
test - ntp_stratum : Passed
skip - sdl_fragmentation : This module must be run directly and off hours
skip - sdi_fragmentation : This module must be run directly and off hours
Diagnostics Completed
The final output will be in Log file: platform/log/diag1.log
Please use 'file view activelog platform/log/diag1.log' command to see the output
admin:
如果NTP在utils diagnose test輸出中失敗,您會看到類似以下內容:
admin:utils diagnose test
Log file: platform/log/diag1.log
Starting diagnostic test(s)
===========================
test - disk_space : Passed (available: 6463 MB, used: 12681 MB)
skip - disk_files : This module must be run directly and off hours
test - service_manager : Passed
test - tomcat : Passed
test - tomcat_deadlocks : Passed
test - tomcat_keystore : Passed
test - tomcat_connectors : Passed
test - tomcat_threads : Passed
test - tomcat_memory : Passed
test - tomcat_sessions : Passed
skip - tomcat_heapdump : This module must be run directly and off hours
test - validate_network : Passed
test - raid : Passed
test - system_info : Passed (Collected system information in diagnostic log)
test - ntp_reachability : Warning
The NTP service is restarting, it can take about 5 minutes.
test - ntp_clock_drift : Warning
The local clock is not synchronised.
None of the designated NTP servers are reachable/functioning or legitimate.
test - ntp_stratum : Warning
The local clock is not synchronised.
None of the designated NTP servers are reachable/functioning or legitimate.
skip - sdl_fragmentation : This module must be run directly and off hours
確認安裝時NTP是否正常。執行命令:
從裝置(cdrtime > getCurrTime())運行sql select pkid,name,dbinfo('utc_to_datetime', cdrtime)作為CDRTIME
此命令將當前時間與cdrtime(修改表時)進行比較。如果在安裝/升級過程中使用了錯誤的NTP,然後更正了NTP,則每次進行更改時,資料庫都會不同步。當您運行典型的NTP命令(例如,utils ntp status)時,不會出現此問題,因為您已從錯誤的NTP源移動到正常的NTP源。
將錯誤的NTP移到一個好的NTP是件好事;但是,移動到好的NTP源不會修復安裝/升級時建立的表。
運行此命令時,預期輸出如下:
admin:run sql select pkid,name,dbinfo('utc_to_datetime', cdrtime) as CDRTIME from device where cdrtime > getCurrTime()
pkid name cdrtime
==== ==== =======
admin:
如果您有與下一個類似的輸出,則表明用於安裝/升級的NTP尚未使用,並且已導致影響資料庫複製的問題:
admin:run sql select pkid,name,dbinfo('utc_to_datetime', cdrtime) as CDRTIME from device where cdrtime > getCurrTime()
pkid name cdrtime
============================= ===== =====================
bf80dd31-9911-43ce-81fd-a99ec0333fb5 MTP_2 2016-09-11 14:38:14.0
4c38fc05-760d-4afb-96e8-69333c195e74 CFB_2 2016-09-11 14:38:14.0
90878c80-e213-4c7e-82b9-6c780aac72f3 ANN_2 2016-09-11 14:38:14.0
08b5bff4-da94-4dfb-88af-ea9ffa96872c MOH_2 2016-09-11 14:38:14.0
93320e4d-1b73-4099-9a7c-c4cddfadb5d9 MTP_3 2016-09-11 14:38:14.0
a6850d42-5f0a-49ce-9fa3-80d45b800e23 CFB_3 2016-09-11 14:38:14.0
9963c9cb-58b0-4191-93e1-8676584f6461 ANN_3 2016-09-11 14:38:14.0
def79fb7-c801-4fb3-85fb-4e94310bf0bd MOH_3 2016-09-11 14:38:14.0
4cd64584-089b-4331-9291-79774330cbc 2 MTP_4 2016-09-11 14:38:14.0
27b18882-db83-4d14-8bce-d3f8dc439610 CFB_4 2016-09-11 14:38:14.0
a40da882-e04f-4649-b2eb-2f79d1289e81 ANN_4 2016-09-11 14:38:14.0
36575ff4-cdea-4945-87e7-638cc555463e MOH_4 2016-09-11 14:38:14.0
進一步的注意事項
1)如果升級ESXi主機時沒有考慮虛擬機器硬體因素,則可能會遇到NTP問題。
2)確保ESXi版本符合虛擬化矩陣要求。
3)確保ESXi版本和硬體版本相容。
相關資訊