4.4. 将 Cockpit Ceph Installer SSH 密钥复制到集群中的所有节点
Cockpit Ceph 安装程序使用 SSH 连接并配置集群中的节点。为了让安装程序自动执行此操作,安装程序将生成 SSH 密钥对,使其可以在不提示输入密码的情况下访问节点。SSH 公钥必须传输到集群中的所有节点。
先决条件
- 已创建具有 sudo 访问权限的 Ansible 用户。
- 已安装并配置了 Cockpit Ceph 安装程序。
流程
以 Ansible 用户身份登录 Ansible 管理节点。
ssh ANSIBLE_USER@HOST_NAME
例如:
$ ssh admin@jb-ceph4-admin
将 SSH 公钥复制到第一个节点:
sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub _ANSIBLE_USER_@_HOST_NAME_
例如:
$ sudo ssh-copy-id -f -i /usr/share/ansible-runner-service/env/ssh_key.pub admin@jb-ceph4-mon /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/usr/share/ansible-runner-service/env/ssh_key.pub" admin@192.168.122.182's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'admin@jb-ceph4-mon'" and check to make sure that only the key(s) you wanted were added.
对集群中的所有节点重复此步骤