在 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:Would you like to specify a user other than admin for log collection? {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-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:Would you like to specify a user other than admin for log collection? {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),请参见以了解更多详细信息。 "对日志收集进行故障排除"
|