Skip to main content
BeeGFS on NetApp with E-Series Storage
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

部署BeeGFS HA集群

贡献者

使用攻略手册指定部署BeeGFS HA集群时应运行的任务。

概述

本节介绍如何组合用于在NetApp上部署/管理BeeGFS的标准攻略手册。

步骤

创建Ansible攻略手册

创建文件 playbook.yml 并按如下所示进行填充:

  1. 首先定义一组任务(通常称为 "播放")、并且只能在NetApp E系列块节点上运行。我们会使用暂停任务在运行安装之前进行提示(以避免意外运行攻略手册)、然后导入 nar_santricity_management 角色。此角色负责应用中定义的任何常规系统配置 group_vars/eseries_storage_systems.yml 或个人 host_vars/<BLOCK NODE>.yml 文件。

    - hosts: eseries_storage_systems
      gather_facts: false
      collections:
        - netapp_eseries.santricity
      tasks:
        - name: Verify before proceeding.
          pause:
            prompt: "Are you ready to proceed with running the BeeGFS HA role? Depending on the size of the deployment and network performance between the Ansible control node and BeeGFS file and block nodes this can take awhile (10+ minutes) to complete."
        - name: Configure NetApp E-Series block nodes.
          import_role:
            name: nar_santricity_management
  2. 定义对所有文件和块节点运行的播放:

    - hosts: all
      any_errors_fatal: true
      gather_facts: false
      collections:
        - netapp_eseries.beegfs
  3. 在此角色中、我们可以选择定义一组"预任务"、这些任务应在部署HA集群之前运行。这对于验证/安装Python等任何前提条件非常有用。我们还可以注入任何飞行前检查、例如验证是否支持提供的Ansible标记:

      pre_tasks:
        - name: Ensure a supported version of Python is available on all file nodes.
          block:
            - name: Check if python is installed.
              failed_when: false
              changed_when: false
              raw: python --version
              register: python_version
    
            - name: Check if python3 is installed.
              raw: python3 --version
              failed_when: false
              changed_when: false
              register: python3_version
              when: 'python_version["rc"] != 0 or (python_version["stdout"] | regex_replace("Python ", "")) is not version("3.0", ">=")'
    
            - name: Install python3 if needed.
              raw: |
                id=$(grep "^ID=" /etc/*release* | cut -d= -f 2 | tr -d '"')
                case $id in
                  ubuntu) sudo apt install python3 ;;
                  rhel|centos) sudo yum -y install python3 ;;
                  sles) sudo zypper install python3 ;;
                esac
              args:
                executable: /bin/bash
              register: python3_install
              when: python_version['rc'] != 0 and python3_version['rc'] != 0
              become: true
    
            - name: Create a symbolic link to python from python3.
              raw: ln -s /usr/bin/python3 /usr/bin/python
              become: true
              when: python_version['rc'] != 0
          when: inventory_hostname not in groups[beegfs_ha_ansible_storage_group]
    
        - name: Verify any provided tags are supported.
          fail:
            msg: "{{ item }} tag is not a supported BeeGFS HA tag. Rerun your playbook command with --list-tags to see all valid playbook tags."
          when: 'item not in ["all", "storage", "beegfs_ha", "beegfs_ha_package", "beegfs_ha_configure", "beegfs_ha_configure_resource", "beegfs_ha_performance_tuning", "beegfs_ha_backup", "beegfs_ha_client"]'
          loop: "{{ ansible_run_tags }}"
  4. 最后、此Play会为您要部署的BeeGFS版本导入BeeGFS HA角色:

      tasks:
        - name: Verify the BeeGFS HA cluster is properly deployed.
          import_role:
            name: beegfs_ha_7_3 # Alternatively specify: beegfs_ha_7_2.
    备注 每个受支持的BeeGFS主要版本都会保留一个BeeGFS HA角色。这样、用户可以选择何时升级主要/次要版本。目前为BeeGFS 7.3.x (beegfs_7_3)或BeeGFS 7.2.x (beegfs_7_2)。默认情况下、这两个角色将在发布时部署最新的BeeGFS修补程序版本、但用户可以选择覆盖此修补程序、并根据需要部署最新的修补程序。请参见最新信息 "升级指南" 有关详细信息:
  5. 可选:如果要定义其他任务、请记住这些任务是否应定向到 all 主机(包括E系列存储系统)或仅文件节点。如果需要、可使用定义一个专门针对文件节点的新Play - hosts: ha_cluster

单击 "此处" 有关完整攻略手册文件的示例。

安装NetApp Ansible Collections

Ansible和所有依赖关系的BeeGFS收集将在上进行维护 "Ansible Galax河"。在Ansible控制节点上、运行以下命令以安装最新版本:

ansible-galaxy collection install netapp_eseries.beegfs

虽然通常不建议这样做、但也可以安装此集合的特定版本:

ansible-galaxy collection install netapp_eseries.beegfs:==<MAJOR>.<MINOR>.<PATCH>

运行攻略手册

位于包含的Ansible控制节点上的目录中 inventory.ymlplaybook.yml 文件、请按如下所示运行攻略手册:

ansible-playbook -i inventory.yml playbook.yml

根据集群的大小、初始部署可能需要20分钟以上的时间。如果部署因任何原因失败、只需更正任何问题(例如布线不当、节点未启动等)、然后重新启动Ansible攻略手册即可。

指定时 "通用文件节点配置"、如果您选择默认选项让Ansible自动管理基于连接的身份验证、则为 connAuthFile 现在、您可以在中找到用作共享密钥的 <playbook_dir>/files/beegfs/<sysMgmtdHost>_connAuthFile (默认情况下)。任何需要访问文件系统的客户端都需要使用此共享密钥。如果使用配置客户端、则会自动处理此问题 "BeeGFS客户端角色"