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 节点的访问权限.

流程

  1. 在新 iSCSI 网关主机上,启用 Red Hat Ceph Storage Tools 软件仓库:

    示例

    [root@iscsigw ~]# subscription-manager repos --enable=rhceph-5-tools-for-rhel-8-x86_64-rpms

  2. 安装 ceph-iscsitcmu-runner 软件包:

    示例

    [root@iscsigw ~]# dnf install ceph-iscsi tcmu-runner

  3. 创建规格文件:

    语法

    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

  4. 可选:在防火墙中为新添加的节点/节点添加正确的规则:

    示例

    [root@host01 ~]# firewall-cmd --permanent --add-port=5000/tcp ; firewall-cmd --permanent --add-port=3260/tcp ; firewall-cmd --reload

    注意

    cephadm 可能自行打开端口。

  5. 将 YAML 文件挂载到容器中的一个目录下:

    示例

    [root@host01 ~]# cephadm shell --mount iscsi-gateway.yaml:/var/lib/ceph/iscsi-gateway.yaml

  6. 进入该目录:

    示例

    [ceph: root@host01 /]# cd /var/lib/ceph

  7. 部署 Ceph iSCSI 服务:

    语法

    ceph orch apply -i FILE_NAME.yaml

    示例

    [ceph: root@host01 ceph]# ceph orch apply -i iscsi-gateway.yaml

  8. 可选:使用放置规格部署 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

  9. 验证安装:

    示例

    [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

  10. 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

  11. 输入容器:

    示例

    [ceph: root@host01 /]#  cephadm enter --name iscsi.foo.host02.tetras

  12. 使用 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>

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.