5.3. 以独立模式部署 Red Hat Openshift Container Storage


  1. 在清单文件中,在 [OSEv3:children] 部分添加 glusterfs 来启用 [glusterfs] 组:

    [OSEv3:children]
    masters
    etcd
    nodes
    glusterfs
    Copy to Clipboard Toggle word wrap
  2. [OSEv3:vars] 部分包含以下变量,根据您的配置需要调整它们:

    [OSEv3:vars]
    ...
    openshift_storage_glusterfs_namespace=app-storage
    openshift_storage_glusterfs_storageclass=true
    openshift_storage_glusterfs_storageclass_default=false
    openshift_storage_glusterfs_block_deploy=true
    openshift_storage_glusterfs_block_host_vol_create=true
    openshift_storage_glusterfs_block_host_vol_size=100
    openshift_storage_glusterfs_block_storageclass=true
    openshift_storage_glusterfs_block_storageclass_default=false
    openshift_storage_glusterfs_is_native=false
    openshift_storage_glusterfs_heketi_is_native=true
    openshift_storage_glusterfs_heketi_executor=ssh
    openshift_storage_glusterfs_heketi_ssh_port=22
    openshift_storage_glusterfs_heketi_ssh_user=root
    openshift_storage_glusterfs_heketi_ssh_sudo=false
    openshift_storage_glusterfs_heketi_ssh_keyfile="/root/.ssh/id_rsa"
    Copy to Clipboard Toggle word wrap
    注意

    openshift_storage_glusterfs_block_host_vol_size 使用一个整数,即 Gi 中卷的大小。

  3. 添加 [glusterfs] 部分,其中包含托管 GlusterFS 存储的每个存储节点的条目。对于每个节点,将 glusterfs_devices 设置为作为 GlusterFS 集群一部分完全管理的原始块设备列表。它必须至少列出一个设备。每个设备都必须是裸机的,且无分区或 LVM PV。另外,将 glusterfs_ip 设置为 node.Specify 的 IP 地址,使用以下格式:

    <hostname_or_ip> glusterfs_zone=<zone_number> glusterfs_ip=<ip_address> glusterfs_devices='[ "</path/to/device1/>", "</path/to/device2>", ... ]'
    Copy to Clipboard Toggle word wrap

    例如:

    [glusterfs]
    gluster1.example.com glusterfs_zone=1 glusterfs_ip=192.168.10.11 glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    gluster2.example.com glusterfs_zone=2 glusterfs_ip=192.168.10.12 glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    gluster3.example.com glusterfs_zone=3 glusterfs_ip=192.168.10.13 glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    Copy to Clipboard Toggle word wrap
  4. 前面的步骤详细说明了需要添加到一个更大的、完整的清单文件。要使用完整的清单文件来部署 {gluster},请将文件路径作为以下 playbook 的选项:

    • 对于初始 OpenShift Container Platform 安装:

      ansible-playbook -i <path_to_inventory_file> /usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml
      
      ansible-playbook -i <path_to_inventory_file> /usr/share/ansible/openshift-ansible/playbooks/deploy_cluster.yml
      Copy to Clipboard Toggle word wrap
    • 对于在现有 OpenShift Container Platform 集群上进行独立安装:

      ansible-playbook -i <path_to_inventory_file> /usr/share/ansible/openshift-ansible/playbooks/openshift-glusterfs/config.yml
      Copy to Clipboard Toggle word wrap
  5. Brick 多路是一个功能,允许在一个进程中添加多个 brick。这可以减少资源消耗,并允许我们运行超过相同内存消耗的 brick 数。在每个集群上的其中一个 Red Hat Gluster Storage 节点上执行以下命令来启用 brick-multiplexing:

    1. 执行以下命令以启用 brick 多路功能:

      # gluster vol set all cluster.brick-multiplex on
      Copy to Clipboard Toggle word wrap

      例如:

      # gluster vol set all cluster.brick-multiplex on
      Brick-multiplexing is supported only for container workloads(Independent or Converged mode). Also it is advised to make sure that either all volumes are in stopped state or no bricks are running before this option is modified.Do you still want to continue? (y/n) y
      volume set: success
      Copy to Clipboard Toggle word wrap
    2. 重启 heketidb 卷:

      # gluster vol stop heketidbstorage
      Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
      volume stop: heketidbstorage: success
      Copy to Clipboard Toggle word wrap
      # gluster vol start heketidbstorage
      volume start: heketidbstorage: success
      Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat