2019-08-12 14:30:17 +05:30
|
|
|
# Building GlusterFS
|
2015-11-11 14:01:47 +05:30
|
|
|
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
|
2016-12-06 14:27:06 +05:30
|
|
|
- fuse-devel
|
2021-04-01 19:38:14 +05:30
|
|
|
- liburing-devel
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
### Fedora
|
|
|
|
|
|
2018-07-01 15:53:47 +03:00
|
|
|
The following dnf command installs all the build requirements for
|
2015-11-11 14:01:47 +05:30
|
|
|
Fedora,
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# 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 \
|
2021-01-13 19:37:56 +05:30
|
|
|
fuse-devel redhat-rpm-config rpcgen libtirpc-devel make \
|
2021-04-01 19:38:14 +05:30
|
|
|
libuuid-devel liburing-devel
|
2019-09-20 15:23:43 +05:30
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
### Ubuntu
|
|
|
|
|
|
|
|
|
|
The following apt-get command will install all the build requirements on
|
|
|
|
|
Ubuntu,
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# 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 \
|
2021-04-01 19:38:14 +05:30
|
|
|
libacl1-dev liburing-dev
|
2019-09-20 15:23:43 +05:30
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
2020-06-21 07:20:57 +03:00
|
|
|
### CentOS / Enterprise Linux v7
|
2018-07-01 15:53:47 +03:00
|
|
|
|
2020-06-21 07:20:57 +03:00
|
|
|
The following yum command installs the build requirements for CentOS / Enterprise Linux 7,
|
2018-07-01 15:53:47 +03:00
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# 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
|
|
|
|
|
```
|
2020-07-04 18:16:06 +03:00
|
|
|
**Note: You will need to enable the CentOS SIG repos in order to install userspace-rcu-devel package**<br>
|
|
|
|
|
For details check https://wiki.centos.org/SpecialInterestGroup/Storage
|
2020-06-21 07:20:57 +03:00
|
|
|
|
|
|
|
|
### Enable repositories for CentOS 8
|
|
|
|
|
The following yum command enables needed repositories providing the build requirements for CentOS 8,
|
|
|
|
|
```console
|
2021-07-12 17:37:10 +05:30
|
|
|
# yum-config-manager --enable powertools --enable devel
|
2020-06-21 07:20:57 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### CentOS / Enterprise Linux v8
|
|
|
|
|
|
|
|
|
|
The following yum command installs the build requirements for CentOS / Enterprise Linux 8,
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
# 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 \
|
2021-04-01 19:38:14 +05:30
|
|
|
systemtap-sdt-devel tar userspace-rcu-devel rpcgen liburing-devel
|
2020-06-21 07:20:57 +03:00
|
|
|
```
|
2018-07-01 15:53:47 +03:00
|
|
|
|
2015-11-11 14:01:47 +05:30
|
|
|
Building from Source
|
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
|
|
This section describes how to build GlusterFS from source. It is assumed
|
|
|
|
|
you have a copy of the GlusterFS source (either from a released tarball
|
|
|
|
|
or a git clone). All the commands below are to be run with the source
|
|
|
|
|
directory as the working directory.
|
|
|
|
|
|
|
|
|
|
### Configuring for building
|
|
|
|
|
|
|
|
|
|
Run the below commands once for configuring and setting up the build
|
|
|
|
|
process.
|
|
|
|
|
|
|
|
|
|
Run autogen to generate the configure script.
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# ./autogen.sh
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
Once autogen completes successfully a configure script is generated. Run
|
|
|
|
|
the configure script to generate the makefiles.
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# ./configure
|
|
|
|
|
```
|
|
|
|
|
|
2020-06-21 07:20:57 +03:00
|
|
|
For CentOS 7, use:
|
2018-07-01 15:53:47 +03:00
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# ./configure --without-libtirpc
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
If the above build requirements have been installed, running the
|
|
|
|
|
configure script should give the below configure summary,
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
GlusterFS configure summary
|
|
|
|
|
===========================
|
|
|
|
|
FUSE client : yes
|
|
|
|
|
Infiniband verbs : yes
|
|
|
|
|
epoll IO multiplex : yes
|
|
|
|
|
argp-standalone : no
|
|
|
|
|
fusermount : yes
|
|
|
|
|
readline : yes
|
|
|
|
|
georeplication : yes
|
|
|
|
|
Linux-AIO : yes
|
|
|
|
|
Enable Debug : no
|
|
|
|
|
Block Device xlator : yes
|
|
|
|
|
glupy : yes
|
|
|
|
|
Use syslog : yes
|
|
|
|
|
XML output : yes
|
|
|
|
|
Encryption xlator : yes
|
|
|
|
|
Unit Tests : no
|
|
|
|
|
Track priv ports : yes
|
|
|
|
|
POSIX ACLs : yes
|
|
|
|
|
Data Classification : yes
|
|
|
|
|
SELinux features : yes
|
|
|
|
|
firewalld-config : no
|
|
|
|
|
Experimental xlators : yes
|
|
|
|
|
Events : yes
|
|
|
|
|
EC dynamic support : x64 sse avx
|
|
|
|
|
Use memory pools : yes
|
|
|
|
|
Nanosecond m/atimes : yes
|
|
|
|
|
Legacy gNFS server : no
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
During development it is good to enable a debug build. To do this run
|
|
|
|
|
configure with a '--enable-debug' flag.
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# ./configure --enable-debug
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
Further configuration flags can be found by running configure with a
|
|
|
|
|
'--help' flag,
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# ./configure --help
|
|
|
|
|
```
|
|
|
|
|
|
2018-07-22 13:19:09 +05:30
|
|
|
Please note to enable gNFS use the following flag
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# ./configure --enable-gnfs
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
2018-08-29 23:34:07 +05:30
|
|
|
If you are looking at contributing by fixing some of the memory issues,
|
|
|
|
|
use `--enable-asan` option
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# ./configure --enable-asan
|
|
|
|
|
```
|
2018-08-29 23:34:07 +05:30
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2021-04-01 19:38:14 +05:30
|
|
|
|
|
|
|
|
`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
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
# ./configure --disable-linux-io_uring
|
|
|
|
|
```
|
|
|
|
|
|
2015-11-11 14:01:47 +05:30
|
|
|
### Building
|
|
|
|
|
|
|
|
|
|
Once configured, GlusterFS can be built with a simple make command.
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# make
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
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 be
|
|
|
|
|
installed into '/usr/local' prefix. To change the install prefix, give
|
|
|
|
|
the appropriate option to configure. If installing into the default
|
|
|
|
|
prefix, you might need to use 'sudo' or 'su -c' to install.
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# sudo make install
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
2018-08-29 23:34:07 +05:30
|
|
|
NOTE: glusterfs can be installed on any target path. However, the
|
|
|
|
|
`mount.glusterfs` script has to be in `/sbin/mount.glusterfs` for
|
|
|
|
|
mounting via command `mount -t glusterfs` to work. See -t section
|
|
|
|
|
in man 8 mount for more details.
|
|
|
|
|
|
|
|
|
|
|
2015-11-11 14:01:47 +05:30
|
|
|
### Running GlusterFS
|
|
|
|
|
|
|
|
|
|
GlusterFS can be only run as root, so the following commands will need
|
|
|
|
|
to 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 before
|
|
|
|
|
running the below commands.
|
|
|
|
|
|
|
|
|
|
A source install will generally not install any init scripts. So you
|
|
|
|
|
will need to start glusterd manually. To manually start glusterd just
|
|
|
|
|
run,
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
2021-01-13 19:37:56 +05:30
|
|
|
# systemctl daemon-reload
|
|
|
|
|
# systemctl start glusterd
|
2019-09-20 15:23:43 +05:30
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
This will start glusterd and fork it into the background as a daemon
|
|
|
|
|
process. 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 'Building
|
|
|
|
|
from Source' section. After the configuration step, run the following
|
|
|
|
|
steps to build RPMs,
|
|
|
|
|
|
2019-09-20 15:23:43 +05:30
|
|
|
```console
|
|
|
|
|
# cd extras/LinuxRPM
|
|
|
|
|
# make glusterrpms
|
|
|
|
|
```
|
2015-11-11 14:01:47 +05:30
|
|
|
|
|
|
|
|
This will create rpms from the source in 'extras/LinuxRPM'. *(Note: You
|
|
|
|
|
will need to install the rpmbuild requirements including rpmbuild and
|
2020-07-04 18:16:06 +03:00
|
|
|
mock)*<br>
|
2020-06-21 07:20:57 +03:00
|
|
|
For CentOS / Enterprise Linux 8 the dependencies can be installed via:
|
|
|
|
|
```console
|
|
|
|
|
# yum install mock rpm-build selinux-policy-devel
|
|
|
|
|
```
|