This page describes how to build and install GlusterFS.
Build Requirements
The following packages are required for building GlusterFS,
GNU Autotools
- Automake
- Autoconf
- Libtool
lex (generally flex)
- GNU Bison
- OpenSSL
- libxml2
- Python 2.x
- libaio
- libibverbs
- librdmacm
- readline
- lvm2
- glib2
- liburcu
- cmocka
- libacl
- sqlite
- fuse-devel
- liburing-devel
Fedora
The following dnf command installs all the build requirements forFedora,
dnf install automake autoconf libtool flex bison openssl-devel \ libxml2-devel python-devel libaio-devel libibverbs-devel \ librdmacm-devel readline-devel lvm2-devel glib2-devel \ userspace-rcu-devel libcmocka-devel libacl-devel sqlite-devel \ fuse-devel redhat-rpm-config rpcgen libtirpc-devel make \ libuuid-devel liburing-devel gperftools libcurl-devel
Ubuntu
The following apt-get command will install all the build requirements onUbuntu,
sudo apt-get install make automake autoconf libtool flex bison \ pkg-config libssl-dev libxml2-dev python-dev libaio-dev \ libibverbs-dev librdmacm-dev libreadline-dev liblvm2-dev \ libglib2.0-dev liburcu-dev libcmocka-dev libsqlite3-dev \ libacl1-dev liburing-dev google-perftools
CentOS / Enterprise Linux v7
The following yum command installs the build requirements for CentOS / Enterprise Linux 7,
yum install autoconf automake bison cmockery2-devel dos2unix flex \ fuse-devel glib2-devel libacl-devel libaio-devel libattr-devel \ libcurl-devel libibverbs-devel librdmacm-devel libtirpc-devel \ libtool libxml2-devel lvm2-devel make openssl-devel pkgconfig \ pyliblzma python-devel python-eventlet python-netifaces \ python-paste-deploy python-simplejson python-sphinx python-webob \ pyxattr readline-devel rpm-build sqlite-devel systemtap-sdt-devel \ tar userspace-rcu-devel
Note: You will need to enable the CentOS SIG repos in order to install userspace-rcu-devel package
For details check https://wiki.centos.org/SpecialInterestGroup/Storage
Enable repositories for CentOS
The following yum command enables needed repositories providing the build requirements:
CentOS Stream 8:
yum-config-manager --enable powertools --enable devel
CentOS Stream 9:
yum-config-manager --enable crb --enable devel
CentOS / Enterprise Linux v8
The following yum command installs the build requirements for CentOS / Enterprise Linux 8,
yum install autoconf automake bison dos2unix flex fuse-devel glib2-devel \ libacl-devel libaio-devel libattr-devel libcurl-devel libibverbs-devel \ librdmacm-devel libtirpc-devel libuuid-devel libtool libxml2-devel \ lvm2-devel make openssl-devel pkgconfig xz-devel python3-devel \ python3-netifaces python3-paste-deploy python3-simplejson python3-sphinx \ python3-webob python3-pyxattr readline-devel rpm-build sqlite-devel \ systemtap-sdt-devel tar userspace-rcu-devel rpcgen liburing-devel
Building from Source
This section describes how to build GlusterFS from source. It is assumedyou have a copy of the GlusterFS source (either from a released tarballor a git clone). All the commands below are to be run with the sourcedirectory as the working directory.
Configuring for building
Run the below commands once for configuring and setting up the buildprocess.
Run autogen to generate the configure script.
./autogen.sh
Once autogen completes successfully a configure script is generated. Runthe configure script to generate the makefiles.
./configure
For CentOS 7, use:
./configure --without-libtirpc
If the above build requirements have been installed, running theconfigure script should give the below configure summary,
GlusterFS configure summary===========================FUSE client : yesInfiniband verbs : yesepoll IO multiplex : yesargp-standalone : nofusermount : yesreadline : yesgeoreplication : yesLinux-AIO : yesEnable Debug : noBlock Device xlator : yesglupy : yesUse syslog : yesXML output : yesEncryption xlator : yesUnit Tests : noTrack priv ports : yesPOSIX ACLs : yesData Classification : yesSELinux features : yesfirewalld-config : noExperimental xlators : yesEvents : yesEC dynamic support : x64 sse avxUse memory pools : yesNanosecond m/atimes : yesLegacy gNFS server : no
During development it is good to enable a debug build. To do this runconfigure with a '--enable-debug' flag.
./configure --enable-debug
Further configuration flags can be found by running configure with a'--help' flag,
./configure --help
Please note to enable gNFS use the following flag
./configure --enable-gnfs
If you are looking at contributing by fixing some of the memory issues,use --enable-asan
option
./configure --enable-asan
The above option will build with -fsanitize=address -fno-omit-frame-pointer
options and uses the libasan.so shared library, so that needs to be available.
io_uring
is introduced on Linux kernel version 5.1. GlusterFS also needs the user space liburing helper library.If these are not available for your machine or if you wish to build GlusterFS without io_uring support,use --disable-linux-io_uring
option
./configure --disable-linux-io_uring
Building
Once configured, GlusterFS can be built with a simple make command.
make
To speed up the build process on a multicore machine, add a '-jN' flag,where N is the number of parallel jobs.
Installing
Run 'make install' to install GlusterFS. By default, GlusterFS will beinstalled into '/usr/local' prefix. To change the install prefix, givethe appropriate option to configure. If installing into the defaultprefix, you might need to use 'sudo' or 'su -c' to install.
sudo make install
NOTE: glusterfs can be installed on any target path. However, themount.glusterfs
script has to be in /sbin/mount.glusterfs
formounting via command mount -t glusterfs
to work. See -t sectionin man 8 mount for more details.
Running GlusterFS
GlusterFS can be only run as root, so the following commands will needto be run as root. If you've installed into the default '/usr/local'prefix, add '/usr/local/sbin' and '/usr/local/bin' to your PATH beforerunning the below commands.
A source install will generally not install any init scripts. So youwill need to start glusterd manually. To manually start glusterd justrun,
systemctl daemon-reloadsystemctl start glusterd
This will start glusterd and fork it into the background as a daemonprocess. You now run 'gluster' commands and make use of GlusterFS.
Building packages
Building RPMs
Building RPMs is really simple. On a RPM based system, for eg. Fedora,get the source and do the configuration steps as shown in the 'Buildingfrom Source' section. After the configuration step, run the followingsteps to build RPMs,
cd extras/LinuxRPMmake glusterrpms
This will create rpms from the source in 'extras/LinuxRPM'. (Note: Youwill need to install the rpmbuild requirements including rpmbuild andmock)
For Fedora / CentOS / Enterprise Linux 8 the dependencies can be installed via:
yum install mock rpm-build selinux-policy-devel