GlusterFS a little How to

Add more nodes to your peer

gluster peer probe glusterfs-2.domain.com
gluster peer probe glusterfs-3.domain.com

 

Check is your Cluster up and running

 

root@glusterfs-1:~# gluster peer status
Number of Peers: 2
Hostname: glusterfs-3.domain.com
Uuid: c87cbd29-0751-4dce-bf7b-119cbdba0334
State: Peer in Cluster (Connected)
Hostname: glusterfs-2.domain.com
Uuid: b940937d-b9b3-402a-a38b-245db929e481
State: Peer in Cluster (Connected)

 

Check your Cluster Volume status

 

root@-glusterfs-1:~# gluster volume status hybrisdata
Status of volume: hybrisdata
Gluster process                             TCP Port  RDMA Port  Online  Pid
------------------------------------------------------------------------------
Brick glusterfs-1.doamin.com:/opt/data
/hybrisdata                                 N/A       N/A        N       N/A
Brick glusterfs-2.domain.com:/opt/data
/hybrisdata                                 N/A       N/A        N       N/A
Brick glusterfs-3.domain.com:/opt/data
/hybrisdata                                 N/A       N/A        N       N/A
Self-heal Daemon on localhost               N/A       N/A        Y       1243
Self-heal Daemon on glusterfs-3.domain.com  N/A       N/A     Y       1350
Self-heal Daemon on glusterfs-2.domain.com
                                        N/A       N/A        Y       1245
Task Status of Volume hybrisdata
------------------------------------------------------------------------------
There are no active volume tasks

 

Show more Details

 

root@glusterfs-3:/data/hybrisdata# gluster volume status hybrisdata detail
Status of volume: hybrisdata
——————————————————————————
Brick : Brick glusterfs-1.domain.com:/data/hybrisdata
TCP Port : 49153
RDMA Port : 0
Online : Y
Pid : 1924
File System : xfs
Device : /dev/mapper/data-vault
Mount Options : rw,discard
Inode Size : 256
Disk Space Free : 18.7GB
Total Disk Space : 20.0GB
Inode Count : 20967424
Free Inodes : 20685863
——————————————————————————
Brick : Brick glusterfs-2.domain.com:/data/hybrisdata
TCP Port : 49153
RDMA Port : 0
Online : Y
Pid : 2362
File System : xfs
Device : /dev/mapper/data-vault
Mount Options : rw,discard
Inode Size : 256
Disk Space Free : 18.6GB
Total Disk Space : 20.0GB
Inode Count : 20967424
Free Inodes : 20685863
——————————————————————————
Brick : Brick glusterfs-3.domain.com:/data/hybrisdata
TCP Port : 49153
RDMA Port : 0
Online : Y
Pid : 2348
File System : xfs
Device : /dev/mapper/data-vault
Mount Options : rw,discard
Inode Size : 256
Disk Space Free : 18.6GB
Total Disk Space : 20.0GB
Inode Count : 20967424
Free Inodes : 20685861

 

Gluster Pool Overview

 

root@qa-glusterfs-1:/data/hybrisdata# gluster pool list
UUID Hostname State
c87cbd29-0751-4dce-bf7b-119cbdba0334 glusterfs-3.domain.com Connected
b940937d-b9b3-402a-a38b-245db929e481 glusterfs-2.domain.com Connected
17ffa661-2165-41a7-a7c8-0dbdab8e191f localhost Connected

 

Add a Volume to your Cluster

root@qa-glusterfs-1:/opt/data# mkdir hybrisdata
root@qa-glusterfs-1:/opt/data# gluster volume create hybrisdata replica 3 transport tcp glusterfs-1.domain.com:/opt/data/hybrisdata glusterfs-2.domain.com:/opt/data/hybrisdata glusterfs-3.domain.com:/opt/data/hybrisdata
volume create: hybrisdata: success: please start the volume to access data

 

Start a Volume

root@glusterfs-1:/opt/data# gluster volume start hybrisdata
volume start: hybrisdata: success

 

Delete a Volume

 

root@glusterfs-3:~# gluster volume stop testvol
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) yes
volume stop: testvol: success
root@glusterfs-3:~# gluster volume delete testvol
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
volume delete: testvol: success

 

Gluster Volume Mount from Cluster Peer

mount -t glusterfs glusterfs-1.domain.com:/hybrisdata /mnt
mount -t glusterfs glusterfs-2.domain.com:/hybrisdata /mnt
mount -t glusterfs glusterfs-3.domain.com:/hybrisdata /mnt

 

GlusterFS DNS RoundRobin

Add a DNS Entry to your DNS Server

glusterfs.domain are following 3 entrys with glusterfs-1.domain.com, glusterfs-2.domain.com, glusterfs-3.domain.com

Your Client will Access glusterfs.domain:/hybrisdata and the DNS Server is responding every request with an other glusterfs server.

 

Mount GlusterFS from a Client

Install Client Tools

add-apt-repository ppa:gluster/glusterfs-3.8
apt-get update
apt-get install glusterfs-client

 

Edit your FSTAB Entry

vim /etc/fstab

add

glusterfs.domain:/hybrisdata /mnt  glusterfs defaults,_netdev 0 0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s