10.6. 添加更多 iSCSI 网关
作为存储管理员,您可以使用 gwcli
命令行工具或 Red Hat Ceph Storage 仪表板将初始两个 iSCSI 网关扩展到四个 iSCSI 网关。添加更多 iSCSI 网关在使用负载平衡和故障转移选项时为您提供更大的灵活性,同时提供更多冗余。
10.6.1. 先决条件
- 一个正在运行的 Red Hat Ceph Storage 5 集群
- 备用节点或现有 OSD 节点
-
root
权限
10.6.2. 使用 gwcli
添加更多 iSCSI 网关
您可以使用 gwcli
命令行工具添加更多 iSCSI 网关。此流程将两个 iSCSI 网关的默认扩展为四个 iSCSI 网关。
先决条件
- Red Hat Enterprise Linux 8.7 或更高版本。
- 一个正在运行的 Red Hat Ceph Storage 集群。
-
具有
root
用户对新节点或 OSD 节点的访问权限.
流程
在新 iSCSI 网关主机上,启用 Red Hat Ceph Storage Tools 软件仓库:
示例
[root@iscsigw ~]# subscription-manager repos --enable=rhceph-5-tools-for-rhel-8-x86_64-rpms
安装
ceph-iscsi
和tcmu-runner
软件包:示例
[root@iscsigw ~]# dnf install ceph-iscsi tcmu-runner
创建规格文件:
语法
cat iscsi-gateway.yaml service_type: iscsi service_id: SERVICE_ID service_name: SERVICE_NAME placement: hosts: - HOSTNAME_1 - HOSTNAME_2 - HOSTNAME_3 - HOSTNAME_4 spec: pool: POOL_NAME trusted_ip_list: IP_ADDRESS_1, IP_ADDRESS_2, IP_ADDRESS_3, IP_ADDRESS_4
示例
[root@iscsigw ~]# cat iscsi-gateway.yaml service_type: iscsi service_id: iscsi service_name: iscsi.iscsi placement: hosts: - host01 - host02 - host03 - host04 spec: pool: rbd trusted_ip_list: 192.168.0.10,192.168.0.13,192.168.0.198,192.168.0.50,192.168.0.51
可选:在防火墙中为新添加的节点/节点添加正确的规则:
示例
[root@host01 ~]# firewall-cmd --permanent --add-port=5000/tcp ; firewall-cmd --permanent --add-port=3260/tcp ; firewall-cmd --reload
注意cephadm
可能自行打开端口。将 YAML 文件挂载到容器中的一个目录下:
示例
[root@host01 ~]# cephadm shell --mount iscsi-gateway.yaml:/var/lib/ceph/iscsi-gateway.yaml
进入该目录:
示例
[ceph: root@host01 /]# cd /var/lib/ceph
部署 Ceph iSCSI 服务:
语法
ceph orch apply -i FILE_NAME.yaml
示例
[ceph: root@host01 ceph]# ceph orch apply -i iscsi-gateway.yaml
可选:使用放置规格部署 Ceph iSCSI 服务:
语法
ceph orch apply iscsi POOL_NAME --placement="HOSTNAME_1,HOSTNAME_2,HOSTNAME_3,HOSTNAME_4" --trusted_ip_list="IP_ADDRESS_1,IP_ADDRESS_2,IP_ADDRESS_3,IP_ADDRESS_4" admin admin
示例
[ceph: root@host01 ceph]# ceph orch apply iscsi iscsipool --placement="ceph-amk5-m0g9z7-node1-installer,ceph-amk5-m0g9z7-node4" --trusted_ip_list="10.0.210.209,10.0.210.153,192.168.0.50,192.168.0.51" admin admin
验证安装:
示例
[ceph: root@host01 /]# ceph orch ls --service_type=iscsi NAME PORTS RUNNING REFRESHED AGE PLACEMENT iscsi.foo ?:5000 3/3 10m ago 75s host01;host02;host03;host04
在
ceph orch ps
命令中,获取安装 iSCSI 的主机名:示例
[ceph: root@host01 /]# ceph orch ps --daemon_type=iscsi NAME HOST PORTS STATUS REFRESHED AGE MEM USE MEM LIM VERSION IMAGE ID CONTAINER ID iscsi.foo.host02 host02 *:9095 running (2h) 8m ago 2h 85.3M - 2.22.2 ac25aac5d567 ad8c7593d7c0
输入容器:
示例
[ceph: root@host01 /]# cephadm enter --name iscsi.foo.host02.tetras
使用 iSCSI 容器的 gwcli 添加网关:
示例
[root@host02 /]# gwcli /iscsi-target...get1/gateways> goto gateways /iscsi-target...get1/gateways> create host03 192.168.0.50 Adding gateway, sync'ing 1 disk(s) and 1 client(s) ok /iscsi-target...get1/gateways> create host04 192.168.0.51 Adding gateway, sync'ing 1 disk(s) and 1 client(s) ok /iscsi-target...get1/gateways> ls o- gateways .................................................................................................. [Up: 3/3, Portals: 3] o- host01 .................................................................................. [192.168.0.10 (UP)] o- host02.................................................................................. [192.168.0.13 (UP)]s o- host03.................................................................................... [192.168.0.50 (UP)] o- host04.................................................................................... [192.168.0.51 (UP)] /iscsi-target...get1/gateways>