I'm trying to setup a 3 node GlusterFS cluster using Ansible and have run into some issues trying to setup the backend storage.
My current setup consists of 3 nodes, each of which has a 10G disk attached (/dev/vdb) in addition to the primary storage (/dev/vda).
I'm trying to use the official gluster-ansible-role ( https://github.com/gluster/gluster-ansible-infra ) to prepare the backend disks (/dev/vdb). My aim is to:
My playbook is as follows:
- 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'
The playbook fails with the following error:
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"}
I've uploaded the full log file here https://paste.ubuntu.com/p/dGPD7KRPMF/
Details of how this was resolved can be seen here: https://github.com/gluster/gluster-ansible-infra/issues/70
A few changes had to be done to get this to work.
There was a suggestion by the developers to use the 1.0.4 branch instead of the default branch.
The size
variable needs to be set under gluster_infra_thick_lvs
On Debian (Buster), xfsprogs
needs to be installed.
Here's my working playbook.
---
- 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'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.