配置集群节点的密码认证

使用密码代替 SSH 密钥以便允许在 IBM® Cloud Private 集群中的主机之间建立安全连接。

在安装 IBM Cloud Private 集群之前,必须先配置节点之间的认证。

注:可以使用 /<installation_directory>/cluster/config.yaml/<installation_directory>/cluster/hosts 文件在各个节点中为用户配置密码认证。请不要同时使用这两个文件配置密码认证。

您必须为 root 用户或具有 root 访问权的用户名提供密码。

要配置认证而不为每个节点提供密码,请在引导节点上生成 SSH 密钥对,并将该密钥与其他集群节点进行共享。 请参阅在集群节点中共享 SSH 密钥

使用 config.yaml 文件配置密码认证

config.yaml 文件只能用于为密码相同的节点设置密码认证。 如果各个节点的密码不同,请使用 hosts 文件设置密码认证。

将用例的配置参数添加到 /<installation_directory>/cluster/config.yaml 文件中:






用户类型 配置参数
root 用户
        ansible_user: root
        ansible_ssh_pass: SHARED_PASSWORD
        ansible_ssh_common_args: "-oPubkeyAuthentication=no"
      
其中
SHARED_PASSWORD
是每个 root 用户的密码。
非 root 用户
        ansible_user: non_root
        ansible_ssh_pass: SHARED_PASSWORD
        ansible_become: true
        ansible_become_pass: "{{ ansible_ssh_pass }}"
        ansible_ssh_common_args: "-oPubkeyAuthentication=no"
      
其中
SHARED_PASSWORD
是每个用户的密码。

使用 hosts 文件配置密码认证

hosts 文件可用于为使用相同密码或不同密码的节点设置密码认证。

将用例的配置参数添加到 /<installation_directory>/cluster/hosts 文件中: