Installing gluster on a CentOS machine via rpmbuild

I talked previously about my experience getting gluster up and running on Fedora and CentOS Linux servers. The installation process as it currently stands is different between Fedora and CentOS servers. The Fedora package maintainers have build RPMs for gluster, so you can use yum to install everything needed to run gluster:

$ yum install glusterfs flusterfs-fuse glusterfs-server glusterfs-vim glusterfs-devel

Gluster packages aren’t currently available for CentOS 6 (at least they aren’t in extras or centosplus as of this morning), so you are required to build from source if you want to use CentOS as your base operating system. The build process is pretty straight forward, and I’ll share my notes and gotchas with you.

Before you compile a single piece of source code you will need to make sure the development tools group, as well as the rpcbind, readline, fuse and rpm-devel packages are installed. If these aren’t installed you can run yum to add them to your system:

$ yum -y groupinstall “Development tools”

$ yum -y install fuse fuse-devel rpcbind readline-devel libibverbs-devel rpm-devel

Once the pre-requisites are installed you can download and and build gluster:

$ wget http://download.gluster.com/pub/gluster/glusterfs/LATEST/glusterfs-3.2.5.tar.gz

$ rpmbuild -ta glusterfs-3.2.5.tar.gz

The rpmbuild utilities “-ta” option (build source and binary packages from an archive) will build RPMs from a tar archive, and the packages that are produced will be placed in the rpmbuild directory in your home directory once rpmbuild does its magic:

$ cd /home/matty/rpmbuild/RPMS/x86_64

$ ls -la

total 5896
drwxr-xr-x. 2 root root    4096 Nov 26 17:32 .
drwxr-xr-x. 3 root root    4096 Nov 26 17:32 ..
-rw-r--r--. 1 root root 1895624 Nov 26 17:32 glusterfs-core-3.2.5-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 3988860 Nov 26 17:32 glusterfs-debuginfo-3.2.5-1.el6.x86_64.rpm
-rw-r--r--. 1 root root   49260 Nov 26 17:32 glusterfs-fuse-3.2.5-1.el6.x86_64.rpm
-rw-r--r--. 1 root root   50732 Nov 26 17:32 glusterfs-geo-replication-3.2.5-1.el6.x86_64.rpm
-rw-r--r--. 1 root root   35032 Nov 26 17:32 glusterfs-rdma-3.2.5-1.el6.x86_64.rpm

The glusterfs.spec file in the tar archive you downloaded includes the RPM specification, so you can extract the archive and review this file if you are curious what rpmbuild is being instructed to do. To install the packages above we can use our good buddy rpm:

$ rpm -ivh *

Preparing...                ########################################### [100%]
   1:glusterfs-core         ########################################### [ 20%]
   2:glusterfs-fuse         ########################################### [ 40%]
   3:glusterfs-rdma         ########################################### [ 60%]
   4:glusterfs-geo-replicati########################################### [ 80%]
   5:glusterfs-debuginfo    ########################################### [100%]

If the packages installed successfully you can configure your gluster node and start the glusterd service:

$ chkconfig glusterd on

$ service glusterd start

While not quite as easy as ‘yum install gluster*’, it’s still pretty darn simple to get gluster installed and operational on a CentOS Linux server.

2 thoughts on “Installing gluster on a CentOS machine via rpmbuild”

  1. Pingback: Installing gluster on a CentOS machine via rpmbuild | Linux - Vše o Linuxu

Leave a Reply

Your email address will not be published. Required fields are marked *