Jérôme Belleman
Home  •  Tools  •  Posts  •  Talks  •  Travels  •  Graphics  •  About Me

EOS in Ubuntu

17 Feb 2018

EOS – which nowadays stands for “EOS Open Storage” – is primarily deployed in Red Hat-like distributions. How to set up an EOS client in a Debian-based one?

1 In Ubuntu

When I say Debian-based distribution, I'm mainly thinking of a recent Ubuntu, 17.10.1 at the time of writing. The list of RPM package dependencies is documented or can be worked out from running CMake, and I thought it'd be helpful to list the equivalent ones for a fresh Ubuntu installation.

2 With RPMs?

2.1 Using yum

One of the reasons I'm saying EOS is primarily deployed in Red Hat-like distributions is because I couldn't find anything else than RPMs to install it. Be that as it may, Debian-based distributions come with tools for installing RPMs. In fact, it even comes with yum utilities:

sudo apt-get install yum-utils

Subsequently running:

sudo yum-config-manager --add-repo https://dss-ci-repo.web.cern.ch/dss-ci-repo/eos/aquamarine/tag/el-7/x86_64

... or any other URL to a directory containing a repodata/ will be sufficient to create the bespoke .repo file in your /etc/yum/repos.d/. Running yum search eos will promisingly list a number of EOS-related packages. In particular, you can give sudo yum install eos-client a try. Unfortunately, this will rather spectacularly fail because of missing dependencies, some of which blatant. Take for instance the lacking dependency on libgcc_s.so.1. And yet, the libgcc1 package is installed – of course, it is, how could you run anything without it?

The point, clearly, is that running yum in a Debian system will disregard any of the DEB packages you may have installed. Well, I guess it's fair to say it was too much to ask even of such a versatile distribution to support and blend two completely different package management systems.

2.2 Using alien

Another approach could have been to resort to alien which, if it can't resolve dependencies for you, can at least turn RPMs into DEBs before installing them. As such, running:

wget https://dss-ci-repo.web.cern.ch/dss-ci-repo/eos/aquamarine/tag/el-7/x86_64/eos-client-0.3.268-1.el7.x86_64.rpm
sudo alien -i eos-client-0.3.268-1.el7.x86_64.rpm

... will work, but the fact it doesn't lift an eyebrow about potentially missing dependencies is downright suspicious. Sure enough, an eos executable will totally make it to /usr/bin but running it will have it complain about a missing libXrdPosix.so.1 library. Running rpm -qpR eos-client-0.3.268-1.el7.x86_64.rpm will confirm it depends on xrootd-client among many other things. I could then wget xrootd-client in turn and repeat the exercise with alien but that's becoming a right laugh. In fact, I've been having a laugh all along. This clearly never was the sensible approach to begin with. Sorry I've senselessly been wasting your time. Read on.

3 By Compilation

3.1 Only on 64-Bit Systems

I goes without saying, nowadays, you'd say, but because I nonetheless accidentally used a 32-bit system, I thought it'd still be worth mentioning that building EOS only works on a 64-bit architecture. What made made realise that was an unexpected integer size:

/home/eos/eos/common/DbMap.hh:508:12: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t {aka unsigned int}’ [-Wformat=]
     sprintf(timestr+offset, "%9.9lu",order);

3.2 Common Tools

sudo apt-get install -y cmake g++ git

3.3 Which Version?

During my RPM-in-Ubuntu shenanigans, I conservatively set out to install a relatively old EOS 0.3. But what's a genuinely recommended version to deploy? At the time of writing, the EOS GitHub page claims the current production is beryl_aquamarine which it suggests will only work on a elderly XRootD 3.3.6. However, the official EOS documentation states that Beryl/Aquamarine (0.3 series) is being phased out in favour of Citrine (4.1 series). Based on this statement, the rest of this post will describe how to build the latest XRootD version which is 4.8.1 and the latest EOS version which is 4.1.14 and which you can work out from the tags in the git repository:

git clone https://github.com/cern-eos/eos.git
cd eos
git tag -l | sort -V | tail

I just learned about sort's delightful -V option which knows how to sort versions. Interestingly, the numeric sort offered by the -n option wouldn't have delivered the desired result.

3.4 XRootD Build

Install the pleasantly short collection of dependencies, some of which CMake may fail to warn you about:

sudo apt-get install -y zlib1g-dev libssl-dev

Download the latest XRootD tarball, unpack, build and install:

wget http://xrootd.org/download/v4.8.1/xrootd-4.8.1.tar.gz
tar xf xrootd-4.8.1.tar.gz
cd xrootd-4.8.1
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_PERL=FALSE
make
sudo make install

3.5 EOS Build

The dependencies listed in the README file that comes with EOS obviously use RPM-flavoured names, slightly different then to the ones you'd expect in a Debian-based distribution. Some dependencies where omitted too. This set of DEB packages is necessary to build EOS:

sudo apt-get install -y libattr1-dev \
    xfslibs-dev \
    libfuse-dev \
    libreadline-dev \
    libcurl4-gnutls-dev \
    libncurses5-dev \
    libleveldb-dev \
    libzmqpp-dev \
    libkrb5-dev \
    libsparsehash-dev \
    libldap2-dev \
    libjsoncpp-dev \
    libprotobuf-dev \
    protobuf-compiler \
    libmicrohttpd-dev

Clone the EOS git repository build and install. Note that -DCMAKE_INSTALL_PREFIX=/usr is already assumed, so no need to be explicit about it:

git clone https://github.com/cern-eos/eos.git
cd eos
git checkout 4.1.14
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make
sudo make install

As is common nowadays, the README file coming with EOS suggests to run make -j4. However, compiling it uses such a whopping amount of memory that I once ran out of it.

4 Client Configuration

All it take is to export two environment variables, and to rudely quote the official documentation, this is done as follows:

export EOS_MGM_URL="root://<mgm hostname>"
export EOS_HOME="<home dir in eos space>"

Then run the eos command, and you're on your way.

5 References