使用 SSH 访问集群

您可以向集群发出 SSH 请求来执行管理任务。默认情况下,SSH 处于启用状态。

开始之前

关于此任务

步骤

  1. 从管理主机使用以下格式之一输入 ssh 命令:
    • ssh username@hostname_or_IP [command]
    • ssh -l username hostname_or_IP [command]

    如果您使用的是 AD 域用户帐户,则必须使用 domainname\\AD_accountname(域名后使用双反斜杠)或 "domainname\AD_accountname"(使用双引号括起来并在域名后使用单反斜杠)的格式指定 username

    hostname_or_IP 是集群管理 LIF 或节点管理 LIF 的主机名或 IP 地址。建议使用集群管理 LIF。您可以使用 IPv4 或 IPv6 地址。

    SSH 交互式会话不需要 command

SSH 请求示例

以下示例说明用户帐户“joe”是如何发出 SSH 请求来访问集群管理 LIF 为 10.72.137.28 的集群的:

$ ssh joe@10.72.137.28 
Password:
cluster1::> cluster show
Node                  Health  Eligibility
--------------------- ------- ------------
node1                 true    true
node2                 true    true
2 entries were displayed.

cluster1::>
 
$ ssh -l joe 10.72.137.28 cluster show
Password:
Node                  Health  Eligibility
--------------------- ------- ------------
node1                 true    true
node2                 true    true
2 entries were displayed.

$

以下示例说明域“DOMAIN1”中的用户帐户“john”是如何发出 SSH 请求来访问集群管理 LIF 为 10.72.137.28 的集群的:

$ ssh DOMAIN1\\john@10.72.137.28 
Password:
cluster1::> cluster show
Node                  Health  Eligibility
--------------------- ------- ------------
node1                 true    true
node2                 true    true
2 entries were displayed.

cluster1::> 
$ ssh -l "DOMAIN1\john" 10.72.137.28 cluster show
Password:
Node                  Health  Eligibility
--------------------- ------- ------------
node1                 true    true
node2                 true    true
2 entries were displayed.

$