2.11. 配置服务器端加密


作为存储管理员,您可以在无法通过 SSL 发送加密请求的情况下设置服务器端加密来使用 HTTP 将请求发送到 Ceph 对象网关。

此流程使用 HAProxy 作为代理和负载均衡器。

先决条件

  • 对存储集群中所有节点的根级别访问权限。
  • 一个正在运行的 Red Hat Ceph Storage 集群。
  • 已安装 Ceph 对象网关。
  • 已安装 HAProxy。

流程

  1. 编辑 haproxy.cfg 文件:

    示例

    Copy to Clipboard Toggle word wrap
    frontend http_web
        bind *:80
        mode http
        default_backend rgw
    
    frontend rgw­-https
      bind *:443 ssl crt /etc/ssl/private/example.com.pem
      default_backend rgw
    
    backend rgw
        balance roundrobin
        mode http
        server  rgw1 10.0.0.71:8080 check
        server  rgw2 10.0.0.80:8080 check

  2. 注释掉允许访问 http 前端的行,并添加指令来指示 HAProxy 使用 https 前端:

    示例

    Copy to Clipboard Toggle word wrap
    #     frontend http_web
    #     bind *:80
    #     mode http
    #     default_backend rgw
    
    frontend rgw­-https
      bind *:443 ssl crt /etc/ssl/private/example.com.pem
      http-request set-header X-Forwarded-Proto https if { ssl_fc }
      http-request set-header X-Forwarded-Proto https
    # here we set the incoming HTTPS port on the load balancer (eg : 443)
      http-request set-header X-Forwarded-Port 443
      default_backend rgw
    
    backend rgw
        balance roundrobin
        mode http
        server  rgw1 10.0.0.71:8080 check
        server  rgw2 10.0.0.80:8080 check

  3. 在集群的所有节点上,将以下参数添加到 Ceph 配置文件的 [global] 部分:

    Copy to Clipboard Toggle word wrap
      rgw_trust_forwarded_https=true
  4. 启用并启动 HAProxy:

    Copy to Clipboard Toggle word wrap
    [root@haproxy]# systemctl enable haproxy
    [root@haproxy]# systemctl start haproxy
  5. 要确保在 Ansible 运行时 rgw_trust_forwarded_https=true 不会从 Ceph 配置文件中删除,请编辑 ceph-ansible all.yml 文件,并在 ceph_ conf _overrides / global 部分中将 ceph-ansible all.yml 文件设置为 rgw_ trust_forwarded_https

    Copy to Clipboard Toggle word wrap
    ceph_conf_overrides:
       global:
         rgw_trust_forwarded_https: true
  6. 完成更改后,运行 ceph-ansible playbook 以在所有 Ceph 节点上更新配置。
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat, Inc.