簡體   English   中英

使用Ansible設置GlusterFS集群

[英]Setting up GlusterFS cluster using Ansible

我正在嘗試使用Ansible設置3節點GlusterFS集群,並且在嘗試設置后端存儲時遇到了一些問題。

我當前的設置包括3個節點,每個節點除了主存儲(/ dev / vda)之外還附加了10G磁盤(/ dev / vdb)。

我正在嘗試使用官方的gluster-ansible-role( https://github.com/gluster/gluster-ansible-infra )准備后端磁盤(/ dev / vdb)。 我的目標是:

  1. 創建一個卷組“ storage_vg”,其中包含/ dev / vdb作為物理卷。
  2. 從“ storage_vg”創建邏輯卷“ storage_lv”。
  3. 在“ storage_lv”上創建XFS文件系統,並將其掛載在/ mnt / brick下

我的劇本如下:

- hosts: all
  become: True
  roles:
    - gluster.infra
  vars:
    gluster_infra_fw_state: disabled
    gluster_infra_volume_groups:
      vgname: 'storage_vg'
      pvname: '/dev/vdb'
    gluster_infra_thick_lvs:
      vgname: 'storage_vg'
      lvname: 'storage_lv'
    gluster_infra_mount_devices:
      path: '/mnt/brick'
      vgname: 'storage_vg'
      lv: 'storage_lv'

該劇本因以下錯誤而失敗:

TASK [gluster.infra/roles/backend_setup : Group devices by volume group name, including existing devices] ******************************************************************
fatal: [gluster-node1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'str object' has no attribute 'vgname'\n\nThe error appears to be in '/root/.ansible/roles/gluster.infra/roles/backend_setup/tasks/get_vg_groupings.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Group devices by volume group name, including existing devices\n  ^ here\n"}

我已經將完整的日志文件上傳到了這里https://paste.ubuntu.com/p/dGPD7KRPMF/

有關如何解決此問題的詳細信息,請參見此處: https : //github.com/gluster/gluster-ansible-infra/issues/70

為了使它起作用,必須進行一些更改。

  1. 開發人員建議使用1.0.4分支而不是默認分支。

  2. size變量需要在gluster_infra_thick_lvsgluster_infra_thick_lvs

  3. 在Debian(Buster)上,需要安裝xfsprogs

這是我的工作手冊。

---
- hosts: all
  become: True
  roles:
    - gluster.infra
  vars:
    gluster_infra_fw_state: disabled
    gluster_infra_volume_groups:
      - vgname: 'storage_vg'
        pvname: '/dev/vdb'
    gluster_infra_thick_lvs:
      - vgname: 'storage_vg'
        lvname: 'storage_lv'
        pvs: '/dev/vdb'
        size: '100%FREE'
    gluster_infra_mount_devices:
      - path: '/mnt/brick'
        vgname: 'storage_vg'
        lvname: 'storage_lv'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM