本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
故障診斷網路問題
如果您遇到網路問題,您可以使用此處顯示的程序來診斷問題。
您想要擷取封包追蹤
封包追蹤是透過 layer 驗證封包路徑到目的地的程序。您可以使用下列 CLI NetApp ONTAP 命令控制封包追蹤程序:
network tcpdump start – 開始封包追蹤
network tcpdump show – 顯示目前正在執行的封包追蹤
network tcpdump stop – 停止執行中的封包追蹤
這些命令可供在檔案系統上具有 fsxadmin角色的使用者使用。
從檔案系統擷取封包追蹤
-
若要在檔案系統的 NetApp ONTAP CLI 中 SSH,請遵循 Amazon FSx for NetApp ONTAP 使用者指南中 使用 NetApp ONTAP CLI 一節所述的步驟。
ssh fsxadmin@file-system-management-endpoint-ip-address -
使用下列命令,在 ONTAP CLI 中輸入診斷權限層級。
::>set diag提示繼續時,輸入
y。Warning: These diagnostic commands are for use by NetApp personnel only. Do you want to continue? {y|n}: y -
識別檔案系統上您要儲存封包追蹤的位置。磁碟區必須上線,且必須掛載在具有有效連接路徑的命名空間中。使用下列命令來檢查符合這些條件的磁碟區:
::*>volume show -junction-path !- -fields junction-pathvserver volume junction-path ------- --------- ------------- fsx test_vol1 /test_vol1 fsx test_vol2 /test_vol2 fsx test_vol2 /test_vol3 -
使用所需的最低引數啟動追蹤。取代以下項目:
將
node_name取代為節點的名稱 (例如,FsxId01234567890abcdef-01)。將
svm_name取代為儲存虛擬機器的名稱 (例如fsx)。將
junction_path_name取代為磁碟區的名稱 (例如test-vol1)。
::*>debug network tcpdump start -nodenode_name-ipspace Default -pass-through "-i e0e -w /clus/svm_name/junction_path_name"Info: Started network trace on interface "e0e" Warning: Snapshots should be disabled on the tcpdump destination volume while packet traces are occurring. Use the "volume modify -snapshot-policy none -vserver fsx -volume test_vol1" command to disable Snapshots on the tcpdump destination volume.重要
封包追蹤只能在
e0e介面和DefaultIP 空間中擷取。在 FSx for ONTAP 中,所有網路流量都會使用e0e介面。使用封包追蹤時,請記住下列事項:
-
啟動封包追蹤時,您必須包含要存放追蹤檔案的路徑,格式為:/clus/
svm_name/junction-path-name -
或者,提供封包追蹤的檔案名稱。如果未指定 filter_name,則會以
node-name_port-name_yyyymmdd_hhmmss.trc 格式自動產生 -
如果指定滾動追蹤,則 filter_name 的尾碼會加上數字,指出輪換序列中的位置。
ONTAP CLI 也接受下列選用引-pass-through數:
-B, --buffer-size=<KiB> -c <number_of_packets> -C <file_size-mB> -F <filter_expression_filename> -G <rotate_seconds> --time-stamp-precision {micro|nano} -Q, --direction {in|out|inout} -s, --snapshot-length=<bytes> -U, --packet-buffered -W <rotate_file_count> <filter-expression>如需篩選條件表達式的資訊,請參閱 pcap-filter(7) man 頁面
。
-
檢視進行中追蹤:
::*>debug network tcpdump showNode IPspace Port Filename ----------------------- -------- -------- -------- FsxId123456789abcdef-01 Default e0e /clus/fsx/test_vol1/FsxId123456789abcdef-01_e0e_20230605_181451.trc -
停止追蹤:
::*>debug network tcpdump stop -node FsxId123456789abcdef-01 -ipspace Default -port e0eInfo: Stopped network trace on interface "e0e" -
返回管理員權限層級:
::*>set -priv admin::> -
存取封包追蹤。
您的封包追蹤會存放在您使用 debug network tcpdump start命令指定的磁碟區中,並且可以透過 NFS 匯出或與該磁碟區對應的 SMB 共用存取。
如需擷取封包追蹤的詳細資訊,請參閱《》中的如何使用 ONTAP 9.10+ 中的偵錯網路傾印。