Using Gluster: Setting up the environment and installation.

schaffung
Dev Genius
Published in
3 min readJul 10, 2020

--

This is a guide for those looking to get started with Gluster, which is a free and opensource scalable network file system. ( There are various official docs available which will take a generic approach, this is more of a description of the approach which I had taken when I started with gluster.)

Before beginning with the installation of Gluster and other operations ( which we’ll cover in following stories..), one has to get the basic environment and the dependencies resolved.

Gluster is a clustered network file system which implies, we might need to setup the underlying machines of the cluster for trying it out. Now, one doesn’t need multiple machines to just try out the basic features of gluster.

The answer is to use VMs to host multiple machines, and to attach disks to these VMs and then play with gluster.

Now, I use nix based operating system and to be specific, fedora 32. Linux kernel has something called kernel virtualization. Using this feature, one can just install a virtual manager. I am using virt-manager. I think one can look up the required dependencies and installation steps for the virt-manager. ( Also, do look out for the basics of using virt-manager. For now, I won’t be adding additional information on how to use virt-manager. Though I should add one in future.)

Once the virtualization manager of your choice is installed, you can experiment around how to create a VM, modify its network settings, storage, etc.

Now, once you are familiar with the VM creation, network settings and the disk allocation, I would recommend you to create a VM with Fedora32, say if possible, 20GB Storage, 2 GB RAM and 2 CPUs, also attach a disk of about 10 GB to this VM as storage. After doing all the installations into this one VM, we can later on clone it so that one doesn’t have to go through the hassle of setting up the environment for every VM individually.

Next, we would be to install the dependencies of gluster. Now, one can either go with a source install or even a package install. RPM and DEB packages are available for gluster and one can look up to get them. One can also clone the repository and do a source install of gluster.

In this guide, I am going to proceed with the source installation of gluster just to show the dependencies which it has and also, would help get a feel of what we are dealing with.

  1. Go to https://github.com/gluster/glusterfs.
  2. Clone the repository to the VM you have set up.
  3. Now, even if we have the source code, we cannot run the installation as we are bound to get errors. To make and compile gluster, one requires certain basic build tools like autogen, auto-conf etc.
  4. Installing the dependencies. One can simply copy the below command
Installing dependencies for gluster.

Now, if somebody is interested in running the test cases or even creating new test cases to be added to the repository, there are certain packages which would be needed to be installed,

Installing dependencies for test setup

5. Once the installation is done, one can proceed with the source build of glusterfs. Follow the following commands for building glusterfs

Building glusterfs from source

6. Once the gluster has been installed successfully, one would have to start the glusterd daemon. This daemon is central to the working of glusterfs. Use the command,

$ systemctl daemon-reload
$ systemctl start glusterd

There is one more configuration which is required, that is opening the ports for communication between the nodes and nodes with the client. Now, this would usually depend on what network protocol is being used, tcp, or nfs or samba. Hence I would recommend referring the docs for the same.

Now, one just needs to clone this VM and then start experimenting with the features of glusterfs. As stated before this story is concerned with setting up gluster and resolving the dependencies before installation.

Drop a comment if you face any issue…

--

--