Setting Up Hibari from Scratch in a CentOS 5 Virtual Machine

The following is based on a message that I’d sent a few weeks ago to the hibari-questions-en mailing list over at SourceForge. Since then, I’ve streamlined things slightly and added instructions on how to set up a CentOS 5 (inside a VMware virtual machine, though using “real” hardware is certainly OK also) to act as the host for a Hibari server node.

Installing CentOS 5 From Scratch

I was installing on virtual hardware, using VMware Fusion for MacOS.  The virtual machine’s configuration summary: 256MB RAM, 1 CPU, and a 20GB expanding disk.  A Hibari server can consume far more than 256MB of RAM if you’re storing a lot of keys, but for experimentation & development work, 256MB is fine.  Besides, it’s easy to change the amount of RAM when using virtual hardware.

Booting the CentOS 5 server DVD, I chose the graphical installation option.

Partitioning via LVM:

  * LogVol00, /, 19584 MB
  * LogVol01, swap, 768

Clock does not use UTC.  Most people I know don’t use UTC like that, so why does Red Hat (and therefore CentOS) make it the default?

Software package choices:

  * un-select: Desktop - Gnome
  * select: Server
  * Customize later

After first reboot, “Setup Agent” runs automatically:

  * Authentication: change nothing
  * Firewall config: Security level disabled, SELinux disabled
  * Network config: DNS config: set appropriately to your environment
  * Services config: turn off: avahi-daemon, bluetooth, cups, isdn, nfslock, pcscd, portmap, rpcgssd, rpcidmapd, sendmail, yum-updatesd.

    * There are a few other services that could be turned off, but those are mostly small quibbles not worth worrying about.
    * The SSH service is on by default, hooray.
    * The default sshd config allows "root" to log in, which I frequently use.  Your opinion may not agree.

Once booted fully to a login prompt, log in, install VMware tools, use defaults for everything, and then reboot.

Building Erlang

The blog article at ErlangExamples.com has the longer explanation.  A really short summary of how to install the prerequisite software packages is:

<code>sudo yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel</code>

I put Erlang in a non-standard place because it’s easier to deal with multiple releases of the Erlang runtime on the same machine. By default (i.e., without using the “--prefix” argument to “./configure”), the main Erlang commands “erl” and “erlc” are installed in /usr/local/bin.  With the commands below, those commands will be available instead at /usr/local/erlang/R13B04/bin.

  tar zxvf otp_src_R13B04.tar.gz
  cd otp_src_R13B04
  ./configure --prefix=/usr/local/erlang/R13B04
  make
  make install

Building Hibari

As root:

  yum install libtool ncompress

Bummer, “yum install git” doesn’t know about Git.  Have to build it from scratch.

  mkdir -p /usr/local/src/git
  cd /usr/local/src/git
  wget http://www.kernel.org/pub/software/scm/git/git-1.7.2.tar.bz2
  tar jxvf git-1.7.2.tar.bz2
  cd git-1.7.2
  ./configure
  make
  make install

As non-root (use only one of the 1st or 2nd line, depending on your login shell).

  set path = ($path /usr/local/erlang/R13B04/bin) (csh/tcsh style)
  export PATH=${PATH}:/usr/local/erlang/R13B04/bin (sh/bash style)
  mkdir -p ~/work/hibari
  cd ~/work/hibari
  git clone git://hibari.git.sourceforge.net/gitroot/hibari/bom .
  env BOM_GIT=git://hibari.git.sourceforge.net/gitroot/hibari/ \
  ./bom.sh co src/top/hibari/GDSS
  ./bom.sh make
  make

As root:

  cd /path/to/hibari/pkg
  ./installer-gdss.sh -o silent

And because I install Erlang in a slightly weird place, I needed a symlink to point to the place where /etc/init.d/gdss expects to find it. (As mentioned above, I install it at /usr/local/erlang/R13B04.)  As root:

  ln -s /usr/local/erlang /usr/local/hibari/ert

Now to start Hibari and then configure the local node to be a standalone/1-node system.  Again as root:

  /etc/init.d/gdss start
  /etc/init.d/gdss provision-standalone

That’s it, we’re all done.  You can point your Web browser at http://localhost:23080/ (or substitute the Hibari machine’s DNS hostname or IP address, if that machine isn’t the localhost) to verify that the server is indeed running.