Giter Site home page Giter Site logo

gluster-ansible-cluster's Introduction

gluster.cluster

This role helps the user to set up a GlusterFS cluster, manage gluster volumes and peer operations. The gluster.cluster role has multiple sub-roles which are invoked depending on the variables that are set. The sub-roles are:

  1. gluster_volume - manage gluster volumes(create, delete, start, stop, set)
  2. gluster_brick - perform add/remove/replace operations on existing bricks

Requirements

  • Ansible version 2.5 or above.
  • GlusterFS version 3.2 or above.

Role Variables

These are the superset of role_varibles. They are explained further in the respective sub-roles directory.

gluster_volume


Name Choices Default value Comments
gluster_cluster_arbiter_count UNDEF Number of arbiter bricks to use (Only for arbiter volume types).
gluster_cluster_bricks UNDEF Bricks that form the GlusterFS volume. The format of the bricks would be hostname:mountpoint/brick_dir alternatively user can provide just mountpoint/birck_dir, in such a case gluster_hosts variable has to be set
gluster_cluster_disperse_count UNDEF Disperse count for the volume. If this value is specified, a dispersed volume will be created
gluster_cluster_force yes / no no Force option will be used while creating a volume, any warnings will be suppressed.
gluster_cluster_hosts Contains the list of hosts that have to be peer probed.
gluster_cluster_redundancy_count UNDEF Specifies the number of redundant bricks while creating a disperse volume. If redundancy count is missing an optimal value is computed.
gluster_cluster_replica_count 2 / 3 UNDEF Replica count while creating a volume. Currently replica 2 and replica 3 are supported.
gluster_cluster_state present / absent / started / stopped / set present If value is present volume will be created. If value is absent, volume will be deleted. If value is started, volume will be started. If value is stopped, volume will be stopped.
gluster_cluster_transport tcp / rdma / tcp,rdma tcp The transport type for the volume.
gluster_cluster_volume glustervol Name of the volume. Refer GlusterFS documentation for valid characters in a volume name.

gluster_brick


Name Choices Default value Comments
gluster_cluster_new_bricks UNDEF Contains the list of bricks along with the new bricks to be added to the GlusterFS volume. The format of the bricks is mountpoint/brick_dir
gluster_cluster_hosts UNDEF Contains the list of hosts that have to be peer probed.
gluster_cluster_volume glustervol Name of the volume. Refer GlusterFS documentation for valid characters in a volume name.
gluster_cluster_remove_bricks UNDEF Contains the list of bricks to be removed.

Example Playbook


Create a GlusterFS volume and set specific options.

---
- name: Create Gluster cluster
  hosts: gluster_servers
  remote_user: root
  gather_facts: false

  vars:
    # gluster volume
    gluster_cluster_hosts:
      - 10.70.41.212
      - 10.70.42.156
    gluster_cluster_volume: testvol
    gluster_cluster_transport: 'tcp'
    gluster_cluster_force: 'yes'
    gluster_cluster_bricks: '/mnt/brick1/store,/mnt/brick2/store'

    # variables to create specific type of the volume
    gluster_cluster_replica_count: 2

    # variables to set specific volume options
    gluster_cluster_options: {'performance.cache-size':'256MB'}

  roles:
    - gluster.cluster

License

GPLv3

gluster-ansible-cluster's People

Contributors

devyanikota avatar gabe3886 avatar gobindadas avatar pkesavap avatar rchikatw avatar sac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gluster-ansible-cluster's Issues

gluster.cluster: Add a brick to an existing volume

I should be able to add a brick to the existing cluster

Acceptance criteria

  • * Document the role variables.
  • * Verify that the bricks are added and volume is started.
  • * Verify that rebalance/self-heal is started
  • * Add examples to demonstrate the role

'gluster_cluster_options' not used.

The variable 'gluster_cluster_options' is present in the file 'README.md' and in 'gluster-ansible-cluster/roles/gluster_volume/tasks', but in this last file the line is commented. The variable 'gluster_cluster_options' is presented but not usable.

How to set an option like 'gluster volume set myvol1 cluster.quorum-type auto' ?

Write a README.md

README.md is empty. Should contain documentation to all the variables this role provides.

Support for separate management network for setup.

Currently, the code makes the assumption that the host from which gluster-ansible is run to set up the gluster cluster is connected to the gluster nodes with the same network that is used for gluster communication. This can be seen here: https://github.com/gluster/gluster-ansible-cluster/blob/master/roles/gluster_volume/tasks/main.yml#L7 and here : https://github.com/gluster/gluster-ansible/blob/master/playbooks/gluster-cluster/cluster-vars.yml#L65 .

It would be convenient to allow for those two networks to be separate. I stumbled across this while setting up automation for gluster-samba integration tests in gluster/samba-integration#16. In that scenario I tried to run the gluster-ansible playbook from a setup VM that would only be on the vagrant-libvirt network and not on the cluster network that is created for gluster. I am trying to work around that by adding the setup vm to the cluster network, but it should not be necessary.

I think the tying of the ansible connection to the cluster network is artifical and could be lifted.

Roles Names

Hi,
In the example yml file the below line give error

roles:
  - gluster.volume

When I change this line to

roles:
  - gluster_volume

It works, becasue, I assume, the name of the role directory is "gluster_volume".
Thanks.

Could not find the requested service glusterd: host

Hello
i try install gluster on centos 7.6
Get error: Could not find the requested service glusterd: host

cat ansible.cfg 
[defaults]
inventory = hosts
remote_user = centos
host_key_checking = False
stdout_callback=debug
cat hosts
[gluster_servers]
gluster1 ansible_ssh_host=172.26.9.65
gluster2 ansible_ssh_host=172.26.9.67
gluster3 ansible_ssh_host=172.26.9.66
cat playbook.yml 
---
- name: Create Gluster cluster
  hosts: gluster_servers
  remote_user: centos
  gather_facts: false

  vars:
    # gluster volume
    gluster_cluster_hosts:
      - 172.26.9.65
      - 172.26.9.67
      - 172.26.9.66
    gluster_cluster_volume: testvol
    gluster_cluster_transport: 'tcp'
    gluster_cluster_force: 'yes'
    gluster_cluster_bricks: '/mnt/brick1/store,/mnt/brick2/store'

    # variables to create specific type of the volume
    gluster_cluster_replica_count: 3

    # variables to set specific volume options
    gluster_cluster_options: 'performance.cache-size:256MB'

  roles:
    - gluster.cluster
TASK [gluster.cluster/roles/gluster_volume : Start glusterd on the nodes if not already started] *************************************************************************************************************
failed: [gluster1 -> 172.26.9.65] (item=172.26.9.65) => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "ansible_loop_var": "item", 
    "changed": false, 
    "item": "172.26.9.65"
}

MSG:

Could not find the requested service glusterd: host

failed: [gluster1 -> 172.26.9.67] (item=172.26.9.67) => {
    "ansible_loop_var": "item", 
    "changed": false, 
    "item": "172.26.9.67"
}

MSG:

Could not find the requested service glusterd: host

failed: [gluster1 -> 172.26.9.66] (item=172.26.9.66) => {
    "ansible_loop_var": "item", 
    "changed": false, 
    "item": "172.26.9.66"
}

MSG:

Could not find the requested service glusterd: host

Arbiter brick size

Hi Contributors,

I am experimenting with this and the infra roles and i have successfully setup a cluster with 3 nodes, 2 bricks, replica set to 2 and arbiter count set to 1. I am not fully aware of many intricacies around Gluster but it looks like the Arbiter brick size used is the same as the normal bricks. Does this make sense? My understanding was that the arbiter doesn't need the same space as the normal bricks.

Thank you in advance.

Missing code that will install glusterfs daemon.

Hi, I try to deploy glusterfs in raw machines but I got:

TASK [gluster.cluster/roles/gluster_volume : Start glusterd on the nodes if not already started] *************************************************************************************************************************************************************
failed: [devops-env1-glusterfs-zone1-01 -> 10.11.1.150] (item=devops-env1-glusterfs-zone1-01) => {"changed": false, "item": "devops-env1-glusterfs-zone1-01", "msg": "Could not find the requested service glusterd: host"}

Do I need to create manually ansible task to install it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.