Skip to content

Building GlusterFS

linuxonz edited this page Nov 9, 2023 · 39 revisions

Building GlusterFS

Following versions of GlusterFS are available in respective distributions at the time of creation of these build instructions:

  • RHEL (8.6, 8.7, 9.0, 9.1) has 6.0
  • SLES (15 SP4, 15 SP5) have 9.3
  • Ubuntu 20.04 has 7.2
  • Ubuntu 22.04 has 10.1
  • Ubuntu (23.04, 23.10) has 10.3

The instructions provided below specify the steps to build or install GlusterFS 11.0 on Linux on IBM Z for following distributions:

  • RHEL (7.8, 7.9, 8.6, 8.8, 9.0, 9.2)
  • SLES (12 SP5, 15 SP4, 15 SP5)

Note: For Ubuntu (20.04, 22.04, 23.04, 23.10), please refer to this link to install GlusterFS from the community GlusterFS PPA (ppa:gluster/glusterfs-10).

General Notes:

  • When following the steps below please use a super user unless otherwise specified
  • A directory /<source root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it

Step 1: Build and Install GlusterFS

Step 1.1: Build using script

If you want to build GlusterFS using manual steps, go to Step 1.2.

Use the following commands to build GlusterFS using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/GlusterFS/11.0/build_glusterfs.sh
# Build GlusterFS
bash build_glusterfs.sh    [Provide -h option to check usage,  -t for executing build with tests]

If the build completes successfully, go to STEP 3. In case of error, check logs for more details or go to STEP 1.2 to follow manual build steps.

Step 1.2: Install the dependencies

  • Set environment variables:

    export SOURCE_ROOT=/<source_root>/
    export PREFIX=/usr/local
    export PATCH_URL=https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/GlusterFS/11.0/patch
    
    PATH=${PREFIX}/bin:${PREFIX}/sbin${PATH:+:${PATH}}
    export PATH
    
    PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:${PREFIX}/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
    export PKG_CONFIG_PATH
    
    LD_LIBRARY_PATH=${PREFIX}/lib:${PREFIX}/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    export LD_LIBRARY_PATH
    
    LD_RUN_PATH=${PREFIX}/lib:${PREFIX}/lib64${LD_RUN_PATH:+:${LD_RUN_PATH}}
    export LD_RUN_PATH
  • RHEL (7.8, 7.9)

    yum install -y gcc-c++ rpcgen libtirpc-devel langpacks-en glibc-langpack-en 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 libuuid-devel redhat-rpm-config git gperftools-devel gperftools-libs openssl popt-devel gperf gperftools-devel
  • RHEL (8.6, 8.8)

    yum install -y 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 make openssl-devel pkgconfig xz-devel  python3-devel python3-netifaces  readline-devel rpm-build sqlite-devel systemtap-sdt-devel tar git lvm2-devel python3-paste-deploy python3-simplejson python3-sphinx python3-webob python3-pyxattr userspace-rcu-devel rpcgen liburing-devel gperf gperftools-devel
  • RHEL (9.0, 9.2)

    yum install -y 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 make openssl-devel pkgconfig xz-devel  python3-devel python3-netifaces  readline-devel rpm-build sqlite-devel systemtap-sdt-devel tar git lvm2-devel python3-paste-deploy python3-simplejson python3-sphinx python3-webob python3-pyxattr userspace-rcu-devel rpcgen liburing-devel gperf gperftools-devel iproute
  • SLES (12 SP5)

    zypper install -y autoconf automake bison cmake flex fuse-devel gcc-c++ git-core glib2-devel libacl-devel libaio-devel librdmacm1 libtool liburcu-devel libuuid-devel libxml2-devel lvm2 make pkg-config python3 python3-xattr rdma-core-devel readline-devel openssl-devel zlib-devel which gawk dmraid popt-devel gperftools-devel gperf gperftools libtirpc-devel util-linux iproute util-linux-systemd keyutils-devel
  • SLES (15 SP4, 15 SP5)

    zypper install -y autoconf automake bison cmake flex fuse-devel gcc-c++ git-core glib2-devel libacl-devel libaio-devel librdmacm1 libtool liburcu-devel libuuid-devel libxml2-devel lvm2 make pkg-config python3 python3-xattr rdma-core-devel readline-devel openssl-devel zlib-devel which gawk dmraid popt-devel gperftools-devel gperf gperftools libtirpc-devel rpcgen liburing-devel util-linux hostname iproute util-linux-systemd keyutils-devel

Step 1.3: Build and install dependencies

  • Install GCC 11

  • RHEL (7.8, 7.9)

    yum install -y devtoolset-11-gcc
    scl enable devtoolset-11 bash
  • RHEL (8.6, 8.8)

    yum install -y gcc-toolset-11-gcc-c++
    scl enable gcc-toolset-11 bash
  • SLES (12 SP5)

    zypper addrepo https://download.opensuse.org/repositories/devel:gcc/SLE-12/devel:gcc.repo
    zypper refresh
    zypper install -y gcc11
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 50
    gcc --version
  • Install userspace-rcu (Only on RHEL 7.x and SLES 12 SP5)

    cd $SOURCE_ROOT
    git clone git://git.liburcu.org/userspace-rcu.git
    cd userspace-rcu/
    git checkout v0.7.14
    ./bootstrap
    ./configure
    make
    make install
    ldconfig
  • Install openssl 1.1.1 (Only on RHEL 7.x and SLES 12 SP5)

    cd $SOURCE_ROOT
    git clone https://github.com/openssl/openssl.git
    cd openssl/
    git checkout OpenSSL_1_1_1k
    ./config --prefix=/usr
    make
    make install
    ldconfig
    openssl version -a
    

Step 1.4: Download, Configure and Build GlusterFS

  • Download and configure source

    Note : If git clone fails with SSL certificate issue, execute git config --global http.sslVerify false command and then do git clone.

    cd $SOURCE_ROOT
    git clone https://github.com/gluster/glusterfs
    cd glusterfs
    git checkout v11.0
    ./autogen.sh
    ./configure --enable-gnfs  ##For RHEL 8.x, 9.x and SLES 15.x
    ./configure --enable-gnfs --enable-debug --disable-linux-io_uring --without-libtirpc  ##For RHEL 7.x
    ./configure --enable-gnfs --disable-linux-io_uring  ##For SLES 12 SP5
  • Patch for RHEL 7.x:

    diff --git a/configure.ac b/configure.ac
    index ef07b97..5aed8c1 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -1369,10 +1369,10 @@ if test "x$cc_werror_format_security" = "xyes"; then
     fi
     CFLAGS="$saved_CFLAGS"
    
    -dnl check for gcc -Werror=implicit-function-declaration
    +dnl check for gcc -Wno-error=implicit-function-declaration
     saved_CFLAGS=$CFLAGS
    -CFLAGS="-Werror=implicit-function-declaration"
    -AC_MSG_CHECKING([whether $CC accepts -Werror=implicit-function-declaration])
    +CFLAGS="-Wno-error=implicit-function-declaration"
    +AC_MSG_CHECKING([whether $CC accepts -Wno-error=implicit-function-declaration])
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_implicit=yes], [cc_werror_implicit=no])
     echo $cc_werror_implicit
     if test "x$cc_werror_implicit" = "xyes"; then
  • Patch for SLES 12 SP5:

    diff --git a/configure.ac b/configure.ac
    index ef07b97775..5a539f8e2a 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -1288,15 +1288,11 @@ GF_DISTRIBUTION=
    
     if test x$cross_compiling != xyes; then
         AC_CHECK_FILE([/etc/debian_version])
    -    AC_CHECK_FILE([/etc/SuSE-release])
         AC_CHECK_FILE([/etc/redhat-release])
    
         if test "x$ac_cv_file__etc_debian_version" = "xyes"; then
             GF_DISTRIBUTION=Debian
         fi
    -    if test "x$ac_cv_file__etc_SuSE_release" = "xyes"; then
    -        GF_DISTRIBUTION=SuSE
    -    fi
         if test "x$ac_cv_file__etc_redhat_release" = "xyes"; then
             GF_DISTRIBUTION=Redhat
         fi
    diff --git a/run-tests.sh b/run-tests.sh
    index 6c9cc3084e..ad62fa5261 100755
    --- a/run-tests.sh
    +++ b/run-tests.sh
    @@ -121,12 +121,6 @@ function check_dependencies()
           fi
         fi
    
    -    # Check for netstat
    -    env netstat --version > /dev/null 2>&1
    -    if [ $? -ne 0 ]; then
    -        MISSING="$MISSING netstat"
    -    fi
    -
         # Check for the Perl Test Harness
         env prove --version > /dev/null 2>&1
         if [ $? -ne 0 ]; then
    @@ -158,12 +152,6 @@ function check_dependencies()
             MISSING="$MISSING pidof"
         fi
    
    -    # Check for netstat
    -    env netstat --version > /dev/null 2>&1
    -    if [ $? -ne 0 ]; then
    -        MISSING="$MISSING netstat"
    -    fi
    -
         # Check for killall
         env killall --version > /dev/null 2>&1
         if [ $? -ne 0 ]; then
  • Build and install

    make
    make install

Step 2: Run the test cases (optional)

2.1) Install the testing dependencies

  • RHEL (7.8, 7.9)

    yum install -y acl attr bc bind-utils boost-devel docbook-style-xsl expat-devel gdb net-tools nfs-utils psmisc vim xfsprogs yajl redhat-rpm-config perl-Test-Harness popt-devel procps-ng
    yum install -y pyxattr python3-pip
    pip3 install prettytable
    
  • RHEL (8.6, 8.8)

    yum install -y dbench perl-Test-Harness yajl nfs-utils
  • RHEL (9.0, 9.2)

    yum install -y dbench perl-Test-Harness yajl net-tools psmisc nfs-utils xfsprogs attr procps-ng
    
  • SLES (12 SP5)

    zypper install -y acl attr bc bind-utils gdb libxml2-tools net-tools nfs-utils psmisc vim xfsprogs python-PrettyTable libselinux-devel selinux-tools popt-devel sysvinit-tools libexpat-devel boost-devel
  • SLES (15 SP4, 15 SP5)

    zypper install -y acl attr bc bind-utils gdb libxml2-tools net-tools-deprecated nfs-utils psmisc thin-provisioning-tools vim xfsprogs python3-PrettyTable libselinux-devel selinux-tools popt-devel yajl libyajl-devel sysvinit-tools
  • Link pstack command (For SLES only)

    ln -sf `which gstack` /usr/bin/pstack
  • Build DBENCH (For RH 7.x and SLES)

    cd $SOURCE_ROOT
    git clone https://github.com/sahlberg/dbench
    cd dbench
    git checkout caa52d347171f96eef5f8c2d6ab04a9152eaf113
    ./autogen.sh
    ./configure --datadir=/usr/local/share/doc/loadfiles/
    make
    make install
  • Build thin-provisioning-tools (For RHEL 7.x and SLES 12 SP5 only)

    cd $SOURCE_ROOT
    git clone https://github.com/jthornber/thin-provisioning-tools
    cd thin-provisioning-tools
    git checkout v0.7.6
    autoreconf
    ./configure
    make
    make install
  • Build yajl (For SLES 12 SP5 only)

    cd $SOURCE_ROOT
    git clone https://github.com/lloyd/yajl
    cd yajl
    git checkout 2.1.0
    ./configure
    make install

2.2) Run tests

  • Run the test cases:

    cd $SOURCE_ROOT/glusterfs
    ./run-tests.sh

Step 3: Run the GlusterFS Daemon (Optional)

glusterd

Similar logs should be output in /var/log/glusterfs/glusterd.log:

[2023-08-10 05:58:09.964387 +0000] I [MSGID: 100030] [glusterfsd.c:2872:main] 0-glusterd: Started running version [{arg=glusterd}, {version=11.0}, {cmdlinestr=glusterd}]

Step 4: Test the GlusterFS volume (Optional)

Refer to Documentation for instructions.

References

Clone this wiki locally