Friday, September 18, 2015

gdeploy: Getting Started

This write up is intended to show how a gluster storage volume can be setup using gdeploy.

For some explanation on what is gdeploy and what problems it solves please
see gdeploy: A Short Introduction.

gdeploy works by reading configuration file(s) and performing particular task(s)
based on the values in the configuration file. This write up explains one such
configuration file, which is used to create a volume.

To create a volume on a freshly installed system, we perform the following
actions:

* Setting up backend for the cluster.
* Probing all the peers
* Creating a volume

The above tasks can be performed independently or together in a single
configuration file. For the sake of brevity, let us consider writing a single
configuration file which does the above three steps.

Before anything, create a passwordless ssh login to all the nodes which are
intended to be used to create a cluster.

# ssh-copy-id root@[host/ip]

The following configuration file creates a 2x2 distributed-replicate cluster,
and mounts the volume on one of the servers.


# Configuration for creating a 2x2 cluster: cluster.conf

[hosts]
10.70.46.159
10.70.46.172
10.70.46.185
10.70.47.129

[10.70.46.159]
devices=/dev/vdb

[10.70.46.172]
devices=/dev/sdb

[10.70.46.185]
devices=/dev/vdb

[10.70.47.129]
devices=/dev/sdb

[peer]
manage=probe

[volume]
action=create
volname=glustervol
transport=tcp,rdma
replica=yes
replica_count=2
force=yes

[clients]
action=mount
hosts=10.70.46.159
fstype=glusterfs
client_mount_points=/mnt/gluster

# End: Configuration for 2x2 cluster

Detailed information on configuration file can be found here and here.

Once the configuration file is created, it can be executed by the command:

# gdeploy -c cluster.conf

The output should look like:


INFO: Back-end setup triggered
INFO: Peer management(action: probe) triggered
INFO: Volume management(action: create) triggered


INFO: FUSE mount of volume triggered.

PLAY [gluster_servers] ******************************************************** 

TASK: [Create Physical Volume on all the nodes] *******************************
changed: [10.70.46.172]
changed: [10.70.46.159]
changed: [10.70.47.129]
changed: [10.70.46.185]

PLAY [gluster_servers] ******************************************************** 

TASK: [Create volume group on the disks] ************************************** 

.
.
.

TASK: [Mount the volumes] ***************************************************** 
changed: [10.70.46.159] => (item=/mnt/gluster)

PLAY RECAP ******************************************************************** 
10.70.46.159               : ok=19   changed=17   unreachable=0    failed=0   
10.70.46.172               : ok=13   changed=13   unreachable=0    failed=0   
10.70.46.185               : ok=13   changed=13   unreachable=0    failed=0   
10.70.47.129               : ok=13   changed=13   unreachable=0    failed=0   


===

A distributed-replicate 2x2 volume will be created on the machines listed in [hosts]
section and mounted on 10.70.46.159.