2.2. 更改 CivetWeb 端口
使用 Ansible 安装 Ceph 对象网关时,它会将 CivetWeb 配置为在端口 8080
上运行。Ansible 通过在 Ceph 配置文件中添加类似如下的行来实现此操作:
rgw frontends = civetweb port=192.168.122.199:8080 num_threads=100
rgw frontends = civetweb port=192.168.122.199:8080 num_threads=100
如果 Ceph 配置文件不包含 rgw frontends = civetweb
行,Ceph 对象网关侦听端口 7480
。如果它包含 rgw_frontends = civetweb
行,但没有指定端口,Ceph 对象网关侦听端口 80
。
由于 Ansible 将 Ceph 对象网关配置为侦听端口 8080
,并且安装红帽 Ceph 存储 3 的支持方式是使用 ceph-ansible
,因此端口 8080
被视为红帽 Ceph 存储 3 文档中的默认端口。
先决条件
- 正在运行的红帽 Ceph 存储 3.3 集群。
- Ceph 对象网关节点.
流程
-
在网关节点上,打开
/etc/ceph/
目录中的 Ceph 配置文件。 找到类似以下示例的 RGW 客户端部分:
[client.rgw.gateway-node1] host = gateway-node1 keyring = /var/lib/ceph/radosgw/ceph-rgw.gateway-node1/keyring log file = /var/log/ceph/ceph-rgw-gateway-node1.log rgw frontends = civetweb port=192.168.122.199:8080 num_threads=100
[client.rgw.gateway-node1] host = gateway-node1 keyring = /var/lib/ceph/radosgw/ceph-rgw.gateway-node1/keyring log file = /var/log/ceph/ceph-rgw-gateway-node1.log rgw frontends = civetweb port=192.168.122.199:8080 num_threads=100
Copy to Clipboard Copied! [client.rgw.gateway-node1]
标题将 Ceph 配置文件的这一部分标识为配置 Ceph 存储集群客户端,其中客户端类型是由rgw
标识的 Ceph 对象网关,节点的名称则是gateway-node1
。将默认 Ansible 配置的端口
8080
更改为80
,编辑rgw frontends
行:rgw frontends = civetweb port=192.168.122.199:80 num_threads=100
rgw frontends = civetweb port=192.168.122.199:80 num_threads=100
Copy to Clipboard Copied! 确保
rgw_frontends
键/值对中的port= port-number
之间没有空格。在您要更改端口的任何其他网关节点上重复此步骤。
从每个网关节点重启 Ceph 对象网关服务,使新端口设置生效:
systemctl restart ceph-radosgw.target
# systemctl restart ceph-radosgw.target
Copy to Clipboard Copied! 确定在每个网关节点的防火墙中打开配置的端口:
firewall-cmd --list-all
# firewall-cmd --list-all
Copy to Clipboard Copied! 如果没有打开端口,请添加端口并重新载入防火墙配置:
firewall-cmd --zone=public --add-port 80/tcp --permanent firewall-cmd --reload
# firewall-cmd --zone=public --add-port 80/tcp --permanent # firewall-cmd --reload
Copy to Clipboard Copied!
其它资源
- 如需更多信息,请参阅 通过 CivetWeb 使用 SSL。
- 如需更多信息,请参阅 Civetweb 配置选项。