LeoFS installation

System Requirements

LeoFS development currently targets Debian 6, Ubuntu-Server 12.04 LTS|13.04 and CentOS 6.x, but should work on most Linux platforms with the following software installed:

Installing Erlang

Note

We recommend this installation method. Please follow the relevant instructions for your environment.

Preparation

Install required libraries using yum (CentOS 6.x)

# yum install libuuid-devel cmake check check-devel

Install required libraries using apt-get (Ubuntu Server 12.04 LTS)

# sudo apt-get install build-essential libtool libncurses5-dev libssl-dev cmake check

Install “libatomic_ops” for R15B03-1 (both CentOS and Ubuntu)

$ wget http://www.hpl.hp.com/research/linux/atomic_ops/download/libatomic_ops-7.2d.tar.gz
$ tar xzvf libatomic_ops-7.2d.tar.gz
$ cd libatomic_ops-7.2d
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

Download “Erlang R15B03-1”|”R16B03-1”

## [R15B03-1]
$ cd $WORK_DIR
$ wget http://www.erlang.org/download/otp_src_R15B03-1.tar.gz

## [R16B03-1]
$ cd $WORK_DIR
$ wget http://www.erlang.org/download/otp_src_R16B03-1.tar.gz

Build for Linux (CentOS, Debian and Others)

## [R15B03-1]
$ tar xzf otp_src_R15B03-1.tar.gz
$ cd otp_src_R15B03-1
$ ./configure --prefix=/usr/local/erlang/R15B03 \
              --enable-smp-support \
              --enable-m64-build \
              --enable-halfword-emulator \
              --enable-kernel-poll \
              --without-javac \
              --disable-native-libs \
              --disable-hipe \
              --disable-sctp \
              --enable-threads \
              --with-libatomic_ops=/usr/local
$ make
$ sudo make install

## [R16B03-1]
$ tar xzf otp_src_R16B03-1.tar.gz
$ cd otp_src_R16B03-1
$ ./configure --prefix=/usr/local/erlang/R16B03-1 \
              --enable-smp-support \
              --enable-m64-build \
              --enable-halfword-emulator \
              --enable-kernel-poll \
              --without-javac \
              --disable-native-libs \
              --disable-hipe \
              --disable-sctp \
              --enable-threads \
              --with-libatomic_ops=/usr/local

Confirm

## [R15B03-1]
$ erl
Erlang R15B03 (erts-5.9.3) [source] [64-bit halfword] [smp:2:2] [async-threads:0] [kernel-poll:false]

Eshell V5.9.3  (abort with ^G)
1>

## [R16B03-1]
Erlang R16B03-1 (erts-5.10.4) [source] [64-bit halfword] [smp:8:8] [async-threads:10] [kernel-poll:false]

Eshell V5.10.3  (abort with ^G)
1>

LeoFS

This installation method is based on a source build, so if you do not have Erlang already installed, you need to first install Erlang. Also, building LeoFS from source requires Erlang R15B03-1 or R16B03-1.

File structure

Before running make

$ git clone https://github.com/leo-project/leofs.git

${LEOFS_SRC_DIR}
  |
  |--- LICENSE
  |--- Makefile
  |--- apps/
  |--- deps/
  |--- doc/
  |--- rebar
  |--- rebar.config
  `--- rel/
         |--- leo_gateway/
         |--- leo_manager/
         `--- leo_storage/

After running make

$ cd ${LEOFS_SRC}/
$ make
$ make release

${LEOFS_SRC_DIR}
  |
  |--- LICENSE
  |--- Makefile
  |---- deps/
  |      |--- bear/
  |      |--- bitcask/
  |      |--- cowboy/
  |      |--- eleveldb/
  |      |--- folsom/
  |      |--- jiffy/
  |      |--- leo_backend_db/
  |      |--- leo_cache/
  |      |--- leo_commons/
  |      |--- leo_gateway/
  |      |--- leo_logger/
  |      |--- leo_manager/
  |      |--- leo_mcerl/
  |      |--- leo_mq/
  |      |--- leo_object_storage/
  |      |--- leo_ordning_reda/
  |      |--- leo_redundant_manager/
  |      |--- leo_rpc/
  |      |--- leo_s3_libs/
  |      |--- leo_statistics/
  |      |--- leo_storage/
  |      |--- lz4/
  |      |--- meck/
  |      |--- proper/
  |      |--- ranch/
  |      `--- savanna_commons/
  |---- rebar
  |---- rebar.config
  `---- rel/
         |--- leo_gateway/
         |--- leo_manager/
         `--- leo_storage/

Building

$ cd leofs/
$ make
$ make release
$ cp -r package/leofs ${LEOFS_DEPLOYED_DIR}
$ cd ${LEOFS_DEPLOYED_DIR}/

[LeoFS deployed files layout]
${LEOFS_DEPLOYED_DIR}
  |--- leofs
  |      |--- gateway/
  |      |        |--- bin/
  |      |        |--- erts-5.10.4/
  |      |        |--- etc/
  |      |        |--- lib/
  |      |        |--- log/
  |      |        |--- releases/
  |      |        |--- snmp/
  |      |        `--- work/
  |      |--- manager_0/
  |      |        |--- bin/
  |      |        |--- erts-5.10.4/
  |      |        |--- etc/
  |      |        |--- lib/
  |      |        |--- log/
  |      |        |--- releases/
  |      |        |--- snmp/
  |      |        `--- work/
  |      |--- manager_1/
  |      |        |--- bin/
  |      |        |--- erts-5.10.4/
  |      |        |--- etc/
  |      |        |--- lib/
  |      |        |--- log/
  |      |        |--- releases/
  |      |        |--- snmp/
  |      |        `--- work/
  |      `--- storage/
  |               |--- bin/
  |               |--- erts-5.10.4/
  |               |--- etc/
  |               |--- lib/
  |               |--- log/
  |               |--- releases/
  |               |--- snmp/
  |               `--- work/

Log Dir and Working Dir

Directory Explanation
log/
log/app/ Application logs
log/ring/ RING (routing-table for replication) dump files
log/sasl/ SASL (Erlang system) Logs
work/
work/mnesia/ System internal data stored into ‘Mnesia’
work/queue/ Message queue data stored into ‘bitcask’
${LEOFS_DEPLOYED_DIR}
  |      `--- storage/
  |               |--- bin/
  |               |--- erts-5.10.4/
  |               |--- etc/
  |               |--- lib/
  |               |--- log/
  |               |     |--- app/
  |               |     |--- ring/
  |               |     `--- sasl/
  |               |--- releases/
  |               |--- snmp/
  |               `--- work/
  .                     |--- mnesia
  .                     `--- queue

Firewall Rules

In order for LeoFS to work correctly, it is necessary to set and check the firewall rules in your environment as follows:

Subsystem Direction Ports Notes
Manager-Master Incoming 10010/* Manager console
Manager-Master Incoming 4369/* Erlang RPC from others
Manager-Master Incoming 4020/* SNMP Listen Port
Manager-Master Outgoing */4369 Erlang RPC to others
Manager-Slave Incoming 10011/* Manager console
Manager-Slave Incoming 4369/* Erlang RPC from others
Manager-Slave Incoming 4021/* SNMP Listen Port
Manager-Slave Outgoing */4369 Erlang RPC to others
Storage Incoming 4369/* Erlang RPC from others
Storage Incoming 4010/* SNMP Listen Port
Storage Outgoing */4369 Erlang RPC to others
Gateway Incoming 8080/* HTTP listen port
Gateway Incoming 8443/* HTTPS listen port
Gateway Incoming 4369/* Erlang RPC from others
Gateway Incoming 4000/* SNMP Listen Port
Gateway Outgoing */4369 Erlang RPC to others