GlusterFS on Raspberry Pi

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 371
Joined: Tue Nov 12, 2013 2:05 am

GlusterFS on Raspberry Pi

Post by peter_b »

I'm using a Raspberry Pi as storage server with external USB harddrives. So far so good, but now I'd like to have multiple external disks behave like a single big one.

Thanks to a project we're currently busy with at work, I got to know GlusterFS. Which is perfect for that job.

I'm gonna write down the steps necessary to combine 2 partitions on 2 external USB HDDs together in GlusterFS' "distributed" mode. I'll call the Raspberry Pi server "rasputin" in this HowTo, and the Gluster volume "kitschdata".

0) Format partitions and create "brick" folder on each:
On each cluster disk (actually cluster "partition" to be exact), create a folder named "brick". This will be the root for the filesystem handled by GlusterFS.
In my case the disks are mounted as "disk1" and "disk2" in "/media":

Code: Select all

$ mkdir /media/disk1/brick
$ mkdir /media/disk2/brick
1) Create a volume called "kitschdata" with 2 bricks:

Code: Select all

$ gluster volume create kitschdata rasputin:/media/disk1/brick rasputin:/media/disk2/brick
This should return the following:
Creation of volume kitschdata has been successful. Please start the volume to access data.
NOTE: Don't mount the volume, yet! This will result in unstable, undesired results. It has to be started first.


2) Start the volume:
For some unknown reason, this step is missing in all QuickStart tutorials on the Gluster page, but it's quite obvious:

Code: Select all

$ gluster volume start kitschdata
This should display the following message:
Starting volume kitschdata has been successful
3) Create a mountpoint for the Gluster volume:

Code: Select all

$ mkdir /media/gluster
3) Mount the volume:

Code: Select all

$ mount -t glusterfs rasputin:/kitschdata /media/gluster
Ok. Now we're ready to already read/write data to our Gluster storage in "/media/gluster".
I'd call that fast and easy :)


Links:
Setting up GlusterFS server volumes
manpage of "gluster" command
User avatar
peter_b
Chatterbox
Posts: 371
Joined: Tue Nov 12, 2013 2:05 am

Connection failed. Please check if gluster daemon is operati

Post by peter_b »

[PROBLEM]
If you get the following error upon running "gluster volume create":
Connection failed. Please check if gluster daemon is operational.
[SOLUTION]
You need to start the "glusterd" demon first:

Code: Select all

$ service glusterd start
Post Reply