The great thing about GlusterFS is that it is very easy to use and maintain. Here’s how you can set up your own NAS with GlusterFS. What You Need:

A network GlusterFS Linux Boxes

1. Set Up Your Network

Your best bet is connecting GlusterFS to Gigabit Ethernet and a huge array of servers, plus storage devices. If you don’t have these on hand, two computers or VMs are usually sufficient, particularly if you are just getting the hang of it.

2. Install Your Server

Glusterfs is included in the repository of many Linux distros. Before installation, you can first compare the version numbers between the website and your distro. Keep in mind you might have to manually update the clients. If you have a pretty recent version, you can install the server by typing (in Debian-based distro):

3. Switch to Static IP and Adding/Removing Volumes

Open up the file “etc/network/interfaces”: and remove the line (if present) ifacetho0 inet dynamic, then add the lines: Restart your machine and make sure the network is working. If it does, type in the following: Typing this will create a volume “testvol” which will be stored on the server. Your files will then be located in the “/data” directory which is in the root system and what GlusterFS considers a brick. To verify that it works, type: You can remove the volume later on by typing both: and

4. Mounting the Volume Locally

You can do this easily by finding: Then, use the command below to mount it. Make sure it works before proceeding.

5. Sharing It Over NFS

More recent versions automatically give NFS access to volumes. You still need to add a portmap package to the server in order to make it work though. To do you this, all you need to do is to add a mount point: and type: To make a client mount the share on boot, add the details of the GlusterFS NFS share to /etc/fstab in the normal way. For our example, add the line: That’s it!

Conclusion

Once you’re set up, you can add a new server by following the above steps. Make sure you give your new server a different IP address. To check the status of your new server, type: If you’d like to work with names rather than IP addresses for your servers, you need to add them to the hosts file on your admin machine. All you have to do is edit /etc/hosts with your text editor and add a line (e.g. 192.168.0.101) for each server.