4.3. 安装和配置 Cockpit Ceph 安装程序
在使用 Cockpit Ceph 安装程序安装 Red Hat Ceph Storage 集群之前,您必须在 Ansible 管理节点上安装 Cockpit Ceph 安装程序。
先决条件
- 对 Ansible 管理节点的根级别访问权限.
-
用于 Ansible 应用的
ansible用户帐户。
流程
验证已安装了 Cockpit。
rpm -q cockpit
$ rpm -q cockpitCopy to Clipboard Copied! Toggle word wrap Toggle overflow 例如:
rpm -q cockpit
[admin@jb-ceph4-admin ~]$ rpm -q cockpit cockpit-196.3-1.el8.x86_64Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您看到与上例类似的输出,请跳到验证 Cockpit 正在运行的步骤。如果输出是
package cockpit is not installed,继续安装 Cockpit 步骤。可选:安装 Cockpit。
Red Hat Enterprise Linux 8:
dnf install cockpit
# dnf install cockpitCopy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat Enterprise Linux 7:
yum install cockpit
# yum install cockpitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
验证 Cockpit 正在运行。
systemctl status cockpit.socket
# systemctl status cockpit.socketCopy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您在输出中看到
Active: active (listening),请跳到为 Red Hat Ceph Storage 安装 Cockpit 插件的步骤。如果您看到Active: inactive(dead),请继续执行启用 Cockpit 步骤。可选:启用 Cockpit。
使用
systemctl命令启用 Cockpit:systemctl enable --now cockpit.socket
# systemctl enable --now cockpit.socketCopy to Clipboard Copied! Toggle word wrap Toggle overflow 您将看到类似如下的行:
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket
/usr/lib/systemd/system/cockpit.socket. Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket/usr/lib/systemd/system/cockpit.socket. Copy to Clipboard Copied! Toggle word wrap Toggle overflow 验证 Cockpit 是否正在运行:
systemctl status cockpit.socket
# systemctl status cockpit.socketCopy to Clipboard Copied! Toggle word wrap Toggle overflow 您将看到类似如下的行:
Active: active (listening) since Tue 2020-01-07 18:49:07 EST; 7min ago
Active: active (listening) since Tue 2020-01-07 18:49:07 EST; 7min agoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
安装 Red Hat Ceph Storage 的 Cockpit Ceph 安装程序。
Red Hat Enterprise Linux 8:
dnf install cockpit-ceph-installer
# dnf install cockpit-ceph-installerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat Enterprise Linux 7:
yum install cockpit-ceph-installer
# yum install cockpit-ceph-installerCopy to Clipboard Copied! Toggle word wrap Toggle overflow
以 Ansible 用户身份,使用 sudo 登录容器目录:
注意默认情况下,Cockpit Ceph 安装程序使用
root用户安装 Ceph。若要使用作为安装 Ceph 的先决条件一部分创建的 Ansible 用户,请以 Ansible 用户身份通过sudo运行此流程中的其余命令。Red Hat Enterprise Linux 7
sudo docker login -u CUSTOMER_PORTAL_USERNAME https://registry.redhat.io
$ sudo docker login -u CUSTOMER_PORTAL_USERNAME https://registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow 示例
sudo docker login -u myusername https://registry.redhat.io
[admin@jb-ceph4-admin ~]$ sudo docker login -u myusername https://registry.redhat.io Password: Login Succeeded!Copy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat Enterprise Linux 8
sudo podman login -u CUSTOMER_PORTAL_USERNAME https://registry.redhat.io
$ sudo podman login -u CUSTOMER_PORTAL_USERNAME https://registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow 示例
sudo podman login -u myusername https://registry.redhat.io
[admin@jb-ceph4-admin ~]$ sudo podman login -u myusername https://registry.redhat.io Password: Login Succeeded!Copy to Clipboard Copied! Toggle word wrap Toggle overflow 确定
registry.redhat.io位于容器 registry 搜索路径中。打开以编辑
/etc/containers/registries.conf文件:[registries.search] registries = [ 'registry.access.redhat.com', 'registry.fedoraproject.org', 'registry.centos.org', 'docker.io']
[registries.search] registries = [ 'registry.access.redhat.com', 'registry.fedoraproject.org', 'registry.centos.org', 'docker.io']Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果文件中没有包括
registry.redhat.io,请添加它:[registries.search] registries = ['registry.redhat.io', 'registry.access.redhat.com', 'registry.fedoraproject.org', 'registry.centos.org', 'docker.io']
[registries.search] registries = ['registry.redhat.io', 'registry.access.redhat.com', 'registry.fedoraproject.org', 'registry.centos.org', 'docker.io']Copy to Clipboard Copied! Toggle word wrap Toggle overflow
以 Ansible 用户身份,使用 sudo 启动
ansible-runner-service。sudo ansible-runner-service.sh -s
$ sudo ansible-runner-service.sh -sCopy to Clipboard Copied! Toggle word wrap Toggle overflow 示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出的最后一行包含 Cockpit Ceph 安装程序的 URL。在上例中,URL 是
https://jb-ceph4-admin:9090/cockpit-ceph-installer。记录下在环境中输出的 URL。