4.3. 安装和配置 Cockpit Ceph 安装程序
在使用 Cockpit Ceph 安装程序安装 Red Hat Ceph Storage 集群之前,您必须在 Ansible 管理节点上安装 Cockpit Ceph 安装程序。
先决条件
- 对 Ansible 管理节点的根级别访问权限.
-
用于 Ansible 应用的
ansible
用户帐户。
流程
验证已安装了 Cockpit。
$ rpm -q cockpit
例如:
[admin@jb-ceph4-admin ~]$ rpm -q cockpit cockpit-196.3-1.el8.x86_64
如果您看到与上例类似的输出,请跳到验证 Cockpit 正在运行的步骤。如果输出是
package cockpit is not installed
,继续安装 Cockpit 步骤。可选:安装 Cockpit。
Red Hat Enterprise Linux 8:
# dnf install cockpit
Red Hat Enterprise Linux 7:
# yum install cockpit
验证 Cockpit 正在运行。
# systemctl status cockpit.socket
如果您在输出中看到
Active: active (listening)
,请跳到为 Red Hat Ceph Storage 安装 Cockpit 插件的步骤。如果您看到Active: inactive(dead)
,请继续执行启用 Cockpit 步骤。可选:启用 Cockpit。
使用
systemctl
命令启用 Cockpit:# systemctl enable --now cockpit.socket
您将看到类似如下的行:
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket → /usr/lib/systemd/system/cockpit.socket.
验证 Cockpit 是否正在运行:
# systemctl status cockpit.socket
您将看到类似如下的行:
Active: active (listening) since Tue 2020-01-07 18:49:07 EST; 7min ago
安装 Red Hat Ceph Storage 的 Cockpit Ceph 安装程序。
Red Hat Enterprise Linux 8:
# dnf install cockpit-ceph-installer
Red Hat Enterprise Linux 7:
# yum install cockpit-ceph-installer
以 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
示例
[admin@jb-ceph4-admin ~]$ sudo docker login -u myusername https://registry.redhat.io Password: Login Succeeded!
Red Hat Enterprise Linux 8
$ sudo podman login -u CUSTOMER_PORTAL_USERNAME https://registry.redhat.io
示例
[admin@jb-ceph4-admin ~]$ sudo podman login -u myusername https://registry.redhat.io Password: Login Succeeded!
确定
registry.redhat.io
位于容器 registry 搜索路径中。打开以编辑
/etc/containers/registries.conf
文件:[registries.search] registries = [ 'registry.access.redhat.com', 'registry.fedoraproject.org', 'registry.centos.org', 'docker.io']
如果文件中没有包括
registry.redhat.io
,请添加它:[registries.search] registries = ['registry.redhat.io', 'registry.access.redhat.com', 'registry.fedoraproject.org', 'registry.centos.org', 'docker.io']
以 Ansible 用户身份,使用 sudo 启动
ansible-runner-service
。$ sudo ansible-runner-service.sh -s
示例
[admin@jb-ceph4-admin ~]$ sudo ansible-runner-service.sh -s Checking environment is ready Checking/creating directories Checking SSL certificate configuration Generating RSA private key, 4096 bit long modulus (2 primes) ..................................................................................................................................................................................................................................++++ ......................................................++++ e is 65537 (0x010001) Generating RSA private key, 4096 bit long modulus (2 primes) ........................................++++ ..............................................................................................................................................................................++++ e is 65537 (0x010001) writing RSA key Signature ok subject=C = US, ST = North Carolina, L = Raleigh, O = Red Hat, OU = RunnerServer, CN = jb-ceph4-admin Getting CA Private Key Generating RSA private key, 4096 bit long modulus (2 primes) .....................................................................................................++++ ..++++ e is 65537 (0x010001) writing RSA key Signature ok subject=C = US, ST = North Carolina, L = Raleigh, O = Red Hat, OU = RunnerClient, CN = jb-ceph4-admin Getting CA Private Key Setting ownership of the certs to your user account(admin) Setting target user for ansible connections to admin Applying SELINUX container_file_t context to '/etc/ansible-runner-service' Applying SELINUX container_file_t context to '/usr/share/ceph-ansible' Ansible API (runner-service) container set to rhceph/ansible-runner-rhel8:latest Fetching Ansible API container (runner-service). Please wait... Trying to pull registry.redhat.io/rhceph/ansible-runner-rhel8:latest...Getting image source signatures Copying blob c585fd5093c6 done Copying blob 217d30c36265 done Copying blob e61d8721e62e done Copying config b96067ea93 done Writing manifest to image destination Storing signatures b96067ea93c8d6769eaea86854617c63c61ea10c4ff01ecf71d488d5727cb577 Starting Ansible API container (runner-service) Started runner-service container Waiting for Ansible API container (runner-service) to respond The Ansible API container (runner-service) is available and responding to requests Login to the cockpit UI at https://jb-ceph4-admin:9090/cockpit-ceph-installer to start the install
输出的最后一行包含 Cockpit Ceph 安装程序的 URL。在上例中,URL 是
https://jb-ceph4-admin:9090/cockpit-ceph-installer
。记录下在环境中输出的 URL。