在 MetroCluster IP 交換器上設定日誌收集
在 MetroCluster IP 設定中,您可以設定日誌收集以收集交換器日誌以用於偵錯目的。
|
|
在 Broadcom 和 Cisco 交換器上,每個具有日誌收集功能的叢集都需要一個新使用者。例如,MetroCluster 1、MetroCluster 2、MetroCluster 3 和 MetroCluster 4 都需要在交換器上設定單獨的使用者。不支援同一用戶使用多個 SSH 金鑰。 |
-
如果使用 FIPS 模式,請在設定日誌收集之前完成以下步驟:
-
使用廠商指示在交換器上重新產生 SSH 金鑰。
-
使用
debug system regenerate-systemshell-key-pair在 ONTAP 中重新產生 SSH 金鑰。 -
使用 `system switch ethernet log setup-password`命令重新執行日誌收集設定。
-
-
您必須擁有交換器 `show`命令的存取權限。如果沒有,請建立新的交換器使用者並授予其必要的權限。
-
必須為交換器啟用交換器健全狀況監控。透過檢查 `Is Monitored:`欄位在 `system switch ethernet show`輸出中是否設為 true 來驗證。
-
對於 Broadcom 和 Cisco 交換器的記錄收集:
-
本機使用者必須具有網路管理員權限。
-
為每個啟用日誌收集的叢集建立一個新的交換器使用者。這些交換器不支援相同使用者使用多個 SSH 金鑰,再次執行設定會覆寫現有的 SSH 金鑰。
-
-
為了支援使用 NVIDIA 交換器進行日誌收集,日誌收集使用者必須能夠在不需要密碼的情況下執行 `cl-support`命令。若要允許此操作,請執行:
echo '<user> ALL = NOPASSWD: /usr/cumulus/bin/cl-support' | sudo EDITOR='tee -a' visudo -f /etc/sudoers.d/cumulus
依照適用於您的 ONTAP 版本的步驟設定日誌收集、啟用定期資料收集,並可選擇性地要求隨需支援日誌。
-
若要設定記錄收集、請針對每個交換器執行下列命令。系統會提示您輸入用於記錄收集的交換器名稱、使用者名稱和密碼。
注意:*如果對使用者規範提示回答 *y,請確保使用者俱有必要的權限,如[開始之前] 。
system switch ethernet log setup-passwordcluster1::*> system switch ethernet log setup-password Enter the switch name: <return> The switch name entered is not recognized. Choose from the following list: cs1 cs2 cluster1::*> system switch ethernet log setup-password Enter the switch name: cs1 Would you like to specify a user other than admin for log collection? {y|n}: n Enter the password: <enter switch password> Enter the password again: <enter switch password> cluster1::*> system switch ethernet log setup-password Enter the switch name: cs2 Would you like to specify a user other than admin for log collection? {y|n}: n Enter the password: <enter switch password> Enter the password again: <enter switch password>
|
|
對於 CL 5.11.1,建立使用者 cumulus 並對以下提示回答 y:您要指定管理員以外的使用者進行日誌收集嗎?{y|n}:y |
-
system switch ethernet log modify -device <switch-name> -periodic-enabled truecluster1::*> system switch ethernet log modify -device cs1 -periodic-enabled true Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y cs1: Periodic log collection has been scheduled to run every hour. cluster1::*> system switch ethernet log modify -device cs2 -periodic-enabled true Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y cs2: Periodic log collection has been scheduled to run every hour. cluster1::*> system switch ethernet log show Periodic Periodic Support Switch Log Enabled Log State Log State cs1 true scheduled never-run cs2 true scheduled never-run 2 entries were displayed. -
要求支援記錄收集:
system switch ethernet log collect-support-log -device <switch-name>cluster1::*> system switch ethernet log collect-support-log -device cs1 cs1: Waiting for the next Ethernet switch polling cycle to begin support collection. cluster1::*> system switch ethernet log collect-support-log -device cs2 cs2: Waiting for the next Ethernet switch polling cycle to begin support collection. cluster1::*> *system switch ethernet log show Periodic Periodic Support Switch Log Enabled Log State Log State cs1 false halted initiated cs2 true scheduled initiated 2 entries were displayed. -
若要檢視記錄收集的所有詳細資料、包括啟用、狀態訊息、定期收集的先前時間戳記和檔名、要求狀態、狀態訊息、以及支援集合的先前時間戳記和檔名、請使用下列項目:
system switch ethernet log show -instancecluster1::*> system switch ethernet log show -instance Switch Name: cs1 Periodic Log Enabled: true Periodic Log Status: Periodic log collection has been scheduled to run every hour. Last Periodic Log Timestamp: 3/11/2024 11:02:59 Periodic Log Filename: cluster1:/mroot/etc/log/shm-cluster-info.tgz Support Log Requested: false Support Log Status: Successfully gathered support logs - see filename for their location. Last Support Log Timestamp: 3/11/2024 11:14:20 Support Log Filename: cluster1:/mroot/etc/log/shm-cluster-log.tgz Switch Name: cs2 Periodic Log Enabled: false Periodic Log Status: Periodic collection has been halted. Last Periodic Log Timestamp: 3/11/2024 11:05:18 Periodic Log Filename: cluster1:/mroot/etc/log/shm-cluster-info.tgz Support Log Requested: false Support Log Status: Successfully gathered support logs - see filename for their location. Last Support Log Timestamp: 3/11/2024 11:18:54 Support Log Filename: cluster1:/mroot/etc/log/shm-cluster-log.tgz 2 entries were displayed.
-
若要設定記錄收集、請針對每個交換器執行下列命令。系統會提示您輸入用於記錄收集的交換器名稱、使用者名稱和密碼。
-
注意: * 如果回答 `y`使用者規格提示,請確定使用者擁有中所述的必要權限[開始之前]。
system switch ethernet log setup-password+
cluster1::*> system switch ethernet log setup-password Enter the switch name: <return> The switch name entered is not recognized. Choose from the following list: cs1 cs2 cluster1::*> system switch ethernet log setup-password Enter the switch name: cs1 Would you like to specify a user other than admin for log collection? {y|n}: n Enter the password: <enter switch password> Enter the password again: <enter switch password> cluster1::*> system switch ethernet log setup-password Enter the switch name: cs2 Would you like to specify a user other than admin for log collection? {y|n}: n Enter the password: <enter switch password> Enter the password again: <enter switch password> -
|
|
對於 CL 5.11.1,建立使用者 cumulus 並對以下提示回答 y:您要指定管理員以外的使用者進行日誌收集嗎?{y|n}:y |
-
若要要求支援日誌收集並啟用定期收集,請執行下列命令。這會同時啟動記錄收集的兩種類型:詳細
Support記錄和每小時收集Periodic的資料。system switch ethernet log modify -device <switch-name> -log-request truecluster1::*> system switch ethernet log modify -device cs1 -log-request true Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y Enabling cluster switch log collection. cluster1::*> system switch ethernet log modify -device cs2 -log-request true Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y Enabling cluster switch log collection.等待 10 分鐘、然後檢查記錄收集是否完成:
system switch ethernet log show
|
|
如果記錄收集功能報告任何錯誤狀態(在的輸出中可見 system switch ethernet log show)、請參閱 "疑難排解記錄收集" 以取得進一步詳細資料。
|