gluster / gluster-block

A framework for gluster block storage
GNU General Public License v2.0
74 stars 32 forks source link

How to bring-up gluster-block on Ubuntu ? #215

Open pkalever opened 5 years ago

pkalever commented 5 years ago

Steps to bring gluster-block up and running on ubuntu (tested on 18.04):

[ Lets create a doc based on this later ]

Env details:

root@block:~# uname -a
Linux block 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

root@block:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@block:~# 

Installing gluster-block build time dependencies:

# wget -O - http://download.gluster.org/pub/gluster/glusterfs/5/rsa.pub | apt-key add -
# apt-get install glusterfs-common glusterfs-server
# apt-get install git autoconf automake gcc libtool make file pkg-config libjson-c-dev uuid-dev libtirpc-dev targetcli-fb 

Compiling from source and installing:

# git clone https://github.com/gluster/gluster-block
# cd gluster-block
# ./autogen.sh
# ./configure --with-systemddir=/usr/lib/systemd/system --enable-tirpc=no
# make -j install

Tcmu-runner and targetcli are runtime dependencies, lets install them:

# git clone https://github.com/open-iscsi/tcmu-runner
# cd tcmu-runner
# apt-get install cmake make gcc libnl-3-dev libnl-genl-3-dev libglib2.0-dev zlib1g-dev kmod libkmod-dev
# cmake -DSUPPORT_SYSTEMD=ON -DCMAKE_INSTALL_PREFIX=/usr -Dwith-rbd=false -Dwith-qcow=false -Dwith-zbc=false -Dwi
th-fbo=false
# make install

targetcli, rtslib, configshell packages available on on ubuntu are way old, hence had to install them from source:

# apt-get remove targetcli-fb python-rtslib-fb python3-configshell-fb python3-rtslib-fb
# apt-get install python-setuptools python-gobject
# mkdir /etc/target

# git clone https://github.com/open-iscsi/targetcli-fb
# cd targetcli-fb
# ./setup.py install
# cd - 

# git clone https://github.com/open-iscsi/rtslib-fb
# cd rtslib-fb/
# ./setup.py install
# cp systemd/target.service /usr/lib/systemd/system/target.service
# cd -

# git clone https://github.com/open-iscsi/configshell-fb
# cd configshell-fb/
# ./setup.py install
# cd -

Starting glusterd and creating a block hosting volume:

# systemctl daemon-reload
# systemctl start glusterd

# Lets create a gluster block hosting volume:
# gluster vol create sample 192.168.124.208:/brick force
# gluster vol start sample

Starting gluster-blockd and creating a block volume on top of previously created block hosting volume:

# systemctl start gluster-blockd

# gluster-block create sample/block 192.168.124.208 1GiB --json-pretty
{
  "IQN":"iqn.2016-12.org.gluster-block:01dc0c3c-4597-42b1-9037-444563d477fa",
  "PORTAL(S)":[
    "192.168.124.208:3260"
  ],
  "RESULT":"SUCCESS"
}

# gluster-block delete sample/block --json-pretty
{
  "SUCCESSFUL ON":[
    "192.168.124.208"
  ],
  "RESULT":"SUCCESS"
}

Explore more tests at https://github.com/gluster/gluster-block/blob/master/tests/basic.t and README/Man-Pages.

happy blocking!!

salamani commented 5 years ago

@pkalever Above steps are good for ubuntu. I am able to create the gluster-volume now. I had to copy service files manually and run them. Does make install copied the service files to right locations for you on ubuntu?

pkalever commented 5 years ago

@pkalever Above steps are good for ubuntu. I am able to create the gluster-volume now. I had to copy service files manually and run them. Does make install copied the service files to right locations for you on ubuntu?

@salamani have you noticed '--with-systemddir' flag to configure in my above steps ? # ./configure --with-systemddir=/usr/lib/systemd/system --enable-tirpc=no

That should do it for you. Try '# make distclean' and then start fresh.

salamani commented 5 years ago

Above steps are good! My sincere apologies for it taking so long to confirm it.

pkalever commented 5 years ago

@salamani no problem and I'm glad that it worked for you. Thanks for confirming.

bluecmd commented 4 years ago

I had to install libglusterfs-dev as well, and libgoogle-perftools-dev for tcmu-runner.

ismo-conguairta commented 4 years ago

@pkalever Above steps are good for ubuntu. I am able to create the gluster-volume now. I had to copy service files manually and run them. Does make install copied the service files to right locations for you on ubuntu?

@salamani have you noticed '--with-systemddir' flag to configure in my above steps ?

./configure --with-systemddir=/usr/lib/systemd/system --enable-tirpc=no

That should do it for you. Try '# make distclean' and then start fresh.

I'm testing installation on Debian 10 and even enabling --with-systemddir=/lib/systemd/system results in no unit-service-files in right directory. This happens because:

I think it's better to change the previous lines as the following by replacing every occurrences of /usr/lib/systemd/system with the variable $systemddir

29: AC_SUBST(systemddir)
30: AM_CONDITIONAL([USE_SYSTEMD], test [ -d "$systemddir" ])
31: if test -d "$systemddir"; then
32:     AC_DEFINE([USE_SYSTEMD], [1], [use systemd])
33: fi
davidsbond commented 3 years ago

I'm trying to build gluster-block on Ubuntu 20.04.1 LTS (focal) on arm64

I'm failing at the configure step:

./configure --with-systemddir=/usr/lib/systemd/system --enable-tirpc=no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for rpcgen... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for unistd.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for memory.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
checking glusterfs/api/glfs.h usability... no
checking glusterfs/api/glfs.h presence... no
checking for glusterfs/api/glfs.h... no
checking rpc/pmap_clnt.h usability... yes
checking rpc/pmap_clnt.h presence... yes
checking for rpc/pmap_clnt.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GFAPI... no
checking for GFAPI... no
configure: error: gfapi library >= 3.6 is required to build gluster-block

Any tips on how to fix? I seem to already have libgfapi0 installed.

pkalever commented 3 years ago

configure: error: gfapi library >= 3.6 is required to build gluster-block Any tips on how to fix? I seem to already have libgfapi0 installed.

@davidsbond this means at build time it is not able to find the gfapi library in the standard library paths, could you try exporting your library path and export it as needed?

buhtux commented 3 years ago

I'm trying to build gluster-block on Ubuntu 20.04.1 LTS (focal) on arm64

I'm failing at the configure step:

./configure --with-systemddir=/usr/lib/systemd/system --enable-tirpc=no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for rpcgen... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for unistd.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for memory.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
checking glusterfs/api/glfs.h usability... no
checking glusterfs/api/glfs.h presence... no
checking for glusterfs/api/glfs.h... no
checking rpc/pmap_clnt.h usability... yes
checking rpc/pmap_clnt.h presence... yes
checking for rpc/pmap_clnt.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GFAPI... no
checking for GFAPI... no
configure: error: gfapi library >= 3.6 is required to build gluster-block

Any tips on how to fix? I seem to already have libgfapi0 installed.

Same issue here, figured out: libglusterfs-dev needs to be installed.