Glusterfs -high available redundant storage with Raspberry pi/Centos server
This post is about how to create a high available redundant storage (Glusterfs replicated volume) from Raspberrypi and a centos server. This is just for fun project, which i am experimenting with my new raspberrypi 2 device. This is not a perfect setup, like i am using a 2 nodes replicated volume without quorom,created brick from ext3 filesystem and on root directory etc.Do not use this setup in production 🙂
In this i am using a wifi hotspot router, to act as a DHCP server and connected both the raspberrypi device (server1.vikki.in) using wifi adapter(Edimax 150 Mbps Wireless Nano USB Adaptor) and a laptop running 2 VM’s ( server2.vikki.in and client.vikki.in)in same wireless network (192.168.1.0)
For details about how to enable wifi interface in raspberrypi please go through the Link
Raspberry PI Model 2 – 1GB
Edimax 150 Mbps Wireless Nano USB Adaptor (EW-7811Un)
Cenda T-50 Power Bank 10000 mAh
sandisk ultra 16gb memory card
Step 1 :
Login to Raspberry pi and run the below command to install glusterfs
Step 2 :
Login to the centos VM and do the following.
Download the glusterfs version 3.2.7. Since raspbian OS comes wit 3.2.7 , i am downloading the same version to avoid any conflicts.
Note : I tried a combination of version 3.2.7 and the latest version that comes with redhat EPL , but this doesn’t work out (peer probe connection failed)
Now download and install all the build dependencies
Extract the source file, navigate and do configure
And the finally make and install the gluster
Login to raspberrypi and probe the centos server (server2.vikki.in)
Check the peer status
Similarly login to the centos server and probe the raspberry pi server(server1.vikki.in)
I have a brick /share1 of 1GB size mounted in both raspberrypi and centos server
Now create a replicated volume from any of the server . Here i am creating it from the raspberry pi server(server1.vikki.in)
Creation of volume replicated_volume has been successful. Please start the volume to access data.
Now start the replicated volume
Check the replicated volume info
Now the replicated volume is created . Login to the client (client.vikki.in) and mount the glusterfs volume
The replicated volume is successfully mounted in the client
create some files in gluster volume
Now go to both the server (raspberrypi,centos) and check the individual brick.
Now we can see the files are replicated in both the nodes .
Now bring down one of the server and check if the gluster volume is still accessible in client.