使用 S3 准备对 Ceph Object Gateway 的访问权

在尝试访问网关服务器之前,必须遵循 Ceph Object Gateway 节点上的一些先决条件。

先决条件

  • 安装 Ceph Object Gateway 软件。

  • 对 Ceph Object Gateway 节点的根级别访问。

过程

  1. 作为 root,在防火墙上打开端口 8080 :

    [root@rgw ~]# firewall-cmd --zone=public --add-port=8080/tcp --permanent
    [root@rgw ~]# firewall-cmd --reload
  2. 将通配符添加到要用于网关的 DNS 服务器,如 将通配符添加到 DNS 部分中所述。

    您还可以为本地 DNS 高速缓存设置网关节点。 为此,请执行以下步骤:

    1. 作为 root,安装和设置 dnsmasq:

      [root@rgw ]# yum install dnsmasq
      [root@rgw ]# echo "address=/.FQDN_OF_GATEWAY_NODE/IP_OF_GATEWAY_NODE" | tee --append /etc/dnsmasq.conf
      [root@rgw ]# systemctl start dnsmasq
      [root@rgw ]# systemctl enable dnsmasq

      IP_OF_GATEWAY_NODEFQDN_OF_GATEWAY_NODE 替换为网关节点的 IP 地址和 FQDN。

    2. 作为 root ,请停止 NetworkManager:

      [root@rgw ~]# systemctl stop NetworkManager
      [root@rgw ~]# systemctl disable NetworkManager
    3. 作为 root,将网关服务器的 IP 设置为名称服务器:

      [root@rgw ]# echo "DNS1=IP_OF_GATEWAY_NODE" | tee --append /etc/sysconfig/network-scripts/ifcfg-eth0
      [root@rgw ]# echo "IP_OF_GATEWAY_NODE FQDN_OF_GATEWAY_NODE" | tee --append /etc/hosts
      [root@rgw ]# systemctl restart network
      [root@rgw ]# systemctl enable network
      [root@rgw ~]# systemctl restart dnsmasq

      IP_OF_GATEWAY_NODEFQDN_OF_GATEWAY_NODE 替换为网关节点的 IP 地址和 FQDN。

    4. 验证子域请求:

      [user@rgw ~]$ ping mybucket.FQDN_OF_GATEWAY_NODE

      FQDN_OF_GATEWAY_NODE 替换为网关节点的 FQDN。

      警告: 为本地 DNS 高速缓存设置网关服务器仅用于测试目的。 执行此操作后,将无法访问外部网络。 强烈建议对 IBM Storage 集群和网关节点使用正确的 DNS 服务器。

  3. 请仔细创建 radosgw 用户以进行 S3 访问,并复制生成的 access_keysecret_key。您将需要这些密钥来执行 S3 访问和后续存储区管理任务。 有关更多详细信息,请参阅 创建 S3 用户