<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Glusterfs on despatches</title><link>https://icle.es/tags/glusterfs/</link><description>Recent content in Glusterfs on despatches</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 18 Mar 2026 15:13:17 +0000</lastBuildDate><atom:link href="https://icle.es/tags/glusterfs/index.xml" rel="self" type="application/rss+xml"/><item><title>Expanding glusterfs volumes [1112]</title><link>https://icle.es/2011/12/20/expanding-glusterfs-volumes-1112/</link><pubDate>Tue, 20 Dec 2011 13:26:55 +0000</pubDate><guid>https://icle.es/2011/12/20/expanding-glusterfs-volumes-1112/</guid><description>&lt;p>&lt;a href="https://icle.es/2011/11/24/glusterfs-howto/" title="GlusterFS HOWTO [1108]">Once you have set up a glusterfs volume&lt;/a>,
you might want to expand the volume to add storage. This is an astoundingly easy
task.&lt;/p>
&lt;p>The first thing that you&amp;rsquo;ll want to do is to add in bricks. Bricks are similar
to physical volumes a la LVM. The thing to bear in mind is that depending on
what type of cluster you have (replicated / striped), you will need to add a
certain number of blocks at a time.&lt;/p></description><content:encoded><![CDATA[<p><a href="https://icle.es/2011/11/24/glusterfs-howto/" title="GlusterFS HOWTO [1108]">Once you have set up a glusterfs volume</a>,
you might want to expand the volume to add storage. This is an astoundingly easy
task.</p>
<p>The first thing that you&rsquo;ll want to do is to add in bricks. Bricks are similar
to physical volumes a la LVM. The thing to bear in mind is that depending on
what type of cluster you have (replicated / striped), you will need to add a
certain number of blocks at a time.</p>
<p>Once you have a initialised the nodes, to add in a set of bricks, you need the
following command which adds two more bricks to a cluster which keeps two
replicas.</p>
```bash
$ gluster volume add-brick testvol cserver3:/gdata cserver4:/gdata
```
<p>Once you have done this, you will need to rebalance the cluster, which involves
redistributing the files across all the bricks. There are two steps to this
process, the &ldquo;fixing&rdquo; of the layout changes and the rebalancing of the data
itself. You can perform both tasks together.</p>
<p>As a starting point, to view the status of a rebalance, you can use:</p>
```bash
$ gluster volume rebalance testvol status
```
<p>You can also stop / pause a rebalance with</p>
```bash
$ gluster volume rebalance testvol stop
```
<p>To &ldquo;fix&rdquo; the layout changes, you need to run:</p>
```bash
$ gluster volume rebalance testvol fix-layout start
Starting rebalance on volume test-volume has been successful
```
<p>Rebalancing the volume to migrate the data is easy and can be done using a
similar command:</p>
```bash
$ gluster volume rebalance testvol migrate-data start
```
<p>To complete both in one command, you just need:</p>
```bash
$ gluster volume rebalance testvol start
```
<p>Easy right?</p>
<p>With this mechanism, you have the ability to have storage that can be expanded
on the fly by using additional hardware. You can also remove existing bricks
using:</p>
```bash
$ gluster volume remove-brick testvol cserver2:/gdata
```
<p>This means that you can remove a brick with smaller hard drives, upgrade the
harddrives, and re-integrate into the cluster with bigger hard drives. This
means that you have a cloud like storage solution which you can easily grow as
necessary without worrying about resizing underlying filesystems or hotswapping
hardisks or any of that hassle.</p>
]]></content:encoded></item><item><title>GlusterFS HOWTO [1108]</title><link>https://icle.es/2011/11/24/glusterfs-howto/</link><pubDate>Thu, 24 Nov 2011 20:53:33 +0000</pubDate><guid>https://icle.es/2011/11/24/glusterfs-howto/</guid><description>&lt;p>So, I  am catching up a bit on the technical documentation. A week taken to play
Skyrim combined with various other bits and pieces made this a little difficult.&lt;/p>
&lt;p>On the bright side, there are a few new things that have been worked on so
hopefully plenty of things to cover soon.&lt;/p>
&lt;p>We manage a number of servers and all over the place and all of them require to
be backed up. We also have a number of desktops all with mirrored disks also
getting backed up.&lt;/p>
&lt;p>I like things to be all nicely efficient and its annoying when one server /
desktop runs out of space when another two (or ten) has plenty of space. We grew
to dislike NFS particularly due to the single point of failure and there were
few other options.&lt;/p>
&lt;p>We had tried &lt;a href="http://www.gluster.org/" title="GlusterFS">glusterfs&lt;/a> a few years ago
(think it was at version 1.3 or something) and there were various issues
particularly around small files and configuration was an absolute nightmare.&lt;/p>
&lt;p>With high hopes that version 3.2 was exactly what we were looking for, we set up
three basic machines for testing&lt;/p></description><content:encoded><![CDATA[<p>So, I  am catching up a bit on the technical documentation. A week taken to play
Skyrim combined with various other bits and pieces made this a little difficult.</p>
<p>On the bright side, there are a few new things that have been worked on so
hopefully plenty of things to cover soon.</p>
<p>We manage a number of servers and all over the place and all of them require to
be backed up. We also have a number of desktops all with mirrored disks also
getting backed up.</p>
<p>I like things to be all nicely efficient and its annoying when one server /
desktop runs out of space when another two (or ten) has plenty of space. We grew
to dislike NFS particularly due to the single point of failure and there were
few other options.</p>
<p>We had tried <a href="http://www.gluster.org/" title="GlusterFS">glusterfs</a> a few years ago
(think it was at version 1.3 or something) and there were various issues
particularly around small files and configuration was an absolute nightmare.</p>
<p>With high hopes that version 3.2 was exactly what we were looking for, we set up
three basic machines for testing</p>
<p>Previously, <a href="http://www.gluster.org/" title="GlusterFS">glusterfs</a> required all the
configuration to be completed manually and with text files. It also required a
fairly detailed knowledge of what they called translators and a lot of tweaking
and fiddling with parameters.</p>
<p>I am very happy to report that this is no longer the case with 3.2.</p>
<p>The three servers(cserver[1-3]) are running Ubuntu and was updated to Natty
(11.10) to get access to glusterfs 3.2 (11.04 only had 3.0). One thing to bear
in mind is that the glusterfs website seemed to only have the 64 bit version but
Ubuntu 11.10 also has the 32bit version.</p>
<p>Installing the server part of glusterfs was simple and straightfoward</p>
```bash
$ sudo aptitude install glusterfs-server
```
<p>Once this was done all three servers
(<a href="http://www.tenshu.net/p/terminator.html" title="Terminator">terminator</a> is a godsend
when doing these things across a number of servers), adding the servers into a
&ldquo;cluster&rdquo; was easy enough.</p>
```bash
shri@cserver1:~$ gluster peer probe cserver2
Probe successful

shri@cserver1:~$ sudo gluster peer probe cserver3
Probe successful
```
<p>The thing to note is that these probe statements are two way. In other words,
all three servers are now part of the same cluster.</p>
```bash
shri@cserver3:~$ sudo gluster peer status
Number of Peers: 2

Number of Peers: 3

Hostname: cserver1
Uuid: 8fe63300-e227-4aec-81f3-69b33f894330
State: Peer in Cluster (Connected)

Hostname: cserver2
Uuid: 275ce612-2dd8-4e2a-8cc8-3115ad18c594
State: Peer in Cluster (Connected)
```
<p>The thing is that if you type in an incorrect hostname, the probe will keep
trying to connect to it. I haven&rsquo;t left it running long enough to know if it
every returns.</p>
```bash
shri@cserver3:~# sudo gluster peer probe does-not-exist
^C
shri@cserver3:~# sudo gluster peer status
Number of Peers: 3

Hostname: cserver1
Uuid: 8fe63300-e227-4aec-81f3-69b33f894330
State: Peer in Cluster (Connected)

Hostname: cserver2
Uuid: 275ce612-2dd8-4e2a-8cc8-3115ad18c594
State: Peer in Cluster (Connected)

Hostname: does-not-exist
Uuid: 00000000-0000-0000-0000-000000000000
State: Establishing Connection (Disconnected)
```
<p>Thankfully, removing host does-not-exist is simple enough</p>
```bash
shri@cserver3:~# sudo gluster peer detach does-not-exist
Detach successful
shri@cserver3:~# sudo gluster peer status
Number of Peers: 2

Hostname: cserver1
Uuid: 8fe63300-e227-4aec-81f3-69b33f894330
State: Peer in Cluster (Connected)

Hostname: cserver2
Uuid: 275ce612-2dd8-4e2a-8cc8-3115ad18c594
State: Peer in Cluster (Connected)
```
<p>Creating a volume is straightforward. There are a number of different types of
volumes which you can find out from the documentation. In this particular
instance, we are creating a distributed replicated</p>
```bash
shri@cserver3:~$ sudo gluster volume create testvol replica 2 transport tcp cserver1:/gdata cserver2:/gdata
Creation of testvol has been successful
Please start the volume to access data
```
<p>The reason I have not included cserver3 in here is that the volume needs a
multiple of the replica number of bricks. In the case, the there needs to be a
muliple of 2 number of bricks.</p>
<p>Additionally, you could use rdma instead of tcp if you are using infiniband</p>
<p>Starting the volume is simple enough</p>
```bash
shri@cserver3:~$ sudo gluster volume start testvol
```
<p>this volume is now accessible from all the boxes in the cluster</p>
```bash
shri@cserver1:~# sudo gluster volume info

Volume Name: testvo
Type: Distributed-Replicate
Status: Started
Number of Bricks: 2 x 1 = 2
Transport-type: tcp
Bricks:
Brick1: cserver1:/gdata
Brick2: cserver2:/gdata
```
<p>Mounting this from another box is easy</p>
```bash
$ sudo aptitude install glusterfs-client
$ sudo mount -t glusterfs /mnt cserver:/testvol
```
<p>If you get the error of &ldquo;endpoint not connected&rdquo; when listing the content of the
mount, it is likely because the volume is not started.</p>
<p>If you are curious, check the gdata folders in the bricks after copying some
files into the mount and you&rsquo;ll find them show up intact and on both bricks in
the above example.</p>]]></content:encoded></item></channel></rss>