首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Ansible设置GlusterFS集群

使用Ansible设置GlusterFS集群
EN

Stack Overflow用户
提问于 2019-09-02 07:12:36
回答 1查看 1.9K关注 0票数 1

我正在尝试使用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_lv_vg”创建逻辑卷“vg”。
  3. 在“storage_lv”上创建XFS文件系统,并将其挂载到/mnt/brick下

我的剧本如下:

代码语言:javascript
复制
- 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'

如果出现以下错误,游戏手册将失败:

代码语言:javascript
复制
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/

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-09-03 07:12:44

有关如何解决此问题的详细信息,请参见以下内容:https://github.com/gluster/gluster-ansible-infra/issues/70

必须做一些改变才能使其发挥作用。

  1. 开发人员建议使用1.0.4分支,而不是默认分支。
  2. size变量需要在gluster_infra_thick_lvs下设置
  3. 在Debian (Buster)上,需要安装xfsprogs

这是我的工作手册。

代码语言:javascript
复制
---
- 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'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57752753

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档