9.4.2. 部署 Red Hat Ceph Storage ingress 守护进程
要部署 Ceph ingress 守护进程,您可以执行以下操作:
-
移除现有的
ceph_rgw配置。 - 清理 director Operator 创建的配置。
- 重新部署 Object Storage 服务(swift)。
部署 ingress 守护进程时,会创建两个新容器:
- HAProxy,用于访问后端。
- keepalived,用于拥有虚拟 IP 地址。
您可以使用 rgw 标签将入口守护进程分发到托管 Ceph 对象网关(RGW)守护进程的节点数量。有关在节点上分发守护进程的更多信息,请参阅 Red Hat Ceph Storage 守护进程卡。
完成此步骤后,您可以从 ingress 守护进程访问 RGW 后端,并通过对象存储服务 CLI 使用 RGW。
流程
登录到每个 Controller 节点,并从
/var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg文件中删除以下配置:listen ceph_rgw bind 10.0.0.103:8080 transparent mode http balance leastconn http-request set-header X-Forwarded-Proto https if { ssl_fc } http-request set-header X-Forwarded-Proto http if !{ ssl_fc } http-request set-header X-Forwarded-Port %[dst_port] option httpchk GET /swift/healthcheck option httplog option forwardfor server controller-0.storage.redhat.local 172.17.3.73:8080 check fall 5 inter 2000 rise 2 server controller-1.storage.redhat.local 172.17.3.146:8080 check fall 5 inter 2000 rise 2 server controller-2.storage.redhat.local 172.17.3.156:8080 check fall 5 inter 2000 rise 2重启
haproxy-bundle并确认它已启动:[root@controller-0 ~]# sudo pcs resource restart haproxy-bundle haproxy-bundle successfully restarted [root@controller-0 ~]# sudo pcs status | grep haproxy * Container bundle set: haproxy-bundle [undercloud-0.ctlplane.redhat.local:8787/rh-osbs/rhosp17-openstack-haproxy:pcmklatest]: * haproxy-bundle-podman-0 (ocf:heartbeat:podman): Started controller-0 * haproxy-bundle-podman-1 (ocf:heartbeat:podman): Started controller-1 * haproxy-bundle-podman-2 (ocf:heartbeat:podman): Started controller-2确认没有进程连接到端口 8080:
[root@controller-0 ~]# ss -antop | grep 8080 [root@controller-0 ~]#您可以预期 Object Storage 服务(swift) CLI 无法建立连接:
(overcloud) [root@cephstorage-0 ~]# swift list HTTPConnectionPool(host='10.0.0.103', port=8080): Max retries exceeded with url: /swift/v1/AUTH_852f24425bb54fa896476af48cbe35d3?format=json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc41beb0430>: Failed to establish a new connection: [Errno 111] Connection refused'))为 HAProxy 和 Keepalived 设置所需的镜像:
[ceph: root@controller-0 /]# ceph config set mgr mgr/cephadm/container_image_haproxy registry.redhat.io/rhceph/rhceph-haproxy-rhel9:latest [ceph: root@controller-0 /]# ceph config set mgr mgr/cephadm/container_image_keepalived registry.redhat.io/rhceph/keepalived-rhel9:latest在
controller-0中创建一个名为rgw_ingress的文件:$ SPEC_DIR=${SPEC_DIR:-"$PWD/ceph_specs"} $ vim ${SPEC_DIR}/rgw_ingress将以下内容粘贴到
rgw_ingress文件中:--- service_type: ingress service_id: rgw.rgw placement: label: rgw spec: backend_service: rgw.rgw virtual_ip: 10.0.0.89/24 frontend_port: 8080 monitor_port: 8898 virtual_interface_networks: - <external_network> ssl_cert: ...-
将
<external_network>替换为您的外部网络,如10.0.0.0/24。如需更多信息,请参阅 迁移 Red Hat Ceph Storage RGW 的先决条件。 - 如果启用了 TLS,请添加 SSL 证书和密钥串联,如 配置持久存储 中的 为外部 Red Hat Ceph Storage 集群配置 RGW 所述。
-
将
使用 Ceph 编配器 CLI 应用
rgw_ingressspec:$ SPEC_DIR=${SPEC_DIR:-"$PWD/ceph_specs"} $ cephadm shell -m ${SPEC_DIR}/rgw_ingress -- ceph orch apply -i /mnt/rgw_ingress等待 ingress 部署并查询生成的端点:
$ sudo cephadm shell -- ceph orch ls NAME PORTS RUNNING REFRESHED AGE PLACEMENT crash 6/6 6m ago 3d * ingress.rgw.rgw 10.0.0.89:8080,8898 6/6 37s ago 60s label:rgw mds.mds 3/3 6m ago 3d controller-0;controller-1;controller-2 mgr 3/3 6m ago 3d controller-0;controller-1;controller-2 mon 3/3 6m ago 3d controller-0;controller-1;controller-2 osd.default_drive_group 15 37s ago 3d cephstorage-0;cephstorage-1;cephstorage-2 rgw.rgw ?:8090 3/3 37s ago 4m label:rgw$ curl 10.0.0.89:8080 --- <?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult>[ceph: root@controller-0 /]# —