These instructions currently target a source build from http://github.com/basho/riak on Ubuntu 12.04 LTS
The configuration shows how to enable the new searching and such.
Get your build tools installed for erlang, riak, etc
sudo apt-get install -y build-essential libc6-dev-i386 git openjdk-7-jdk libpam0g-dev libssl0.9.8 pwgen libssl-dev libncurses5-dev
Create a source build directory (optional):
mkdir src
cd src
Install from a binary or build from source. The following is for a source build using kerl.
Download kerl the "Easy building and installing of Erlang/OTP instances" (aka RVM for Erlang)
curl -O https://raw.github.com/spawngrid/kerl/master/kerl
chmod +x kerl
Optionally copy somewhere in your path. Eg. sudo cp kerl /usr/local/bin
Configuration for Erlang build:
KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll"
Same but for OSX
KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-darwin-64bit"
Decide where to install the erlang builds. RVM style:
INSTALL_DIR=$HOME/.kerl/erlangs
mkdir -p $INSTALL_DIR
or somewhere in the system:
INSTALL_DIR=/opt/depot
sudo mkdir -p $INSTALL_DIR
Build and install Erlang:
./kerl build R16B02 r16b02
./kerl install r16b02 $INSTALL_DIR/erlang-r16b02
Use the erlang installed (like rvm use)
. $INSTALL_DIR/erlang-r16b02/activate
Optionally make a env/script that loads the correct version. Example:
echo ". $INSTALL_DIR/erlang-r16b02/activate" | tee erlang-r16b02.env
. $HOME/erlang-r16b02.env
Optional: Add . $HOME/erlang-r16b02.env to ~/.bashrc to have it load when you login.
Get the riak source and build it
git clone https://github.com/basho/riak.git
cd riak
make rel
Edit etc/riak.conf to make the following changes
Change the node name to include the external IP. Example:
nodename = riak@8.8.8.8
NOTE: You may need to remove the old ring data rm data/ring/*
or you could get a ... orddict,fetch,['riak@ ... error
Set the cookie for cluster communication. Use pwgen -sB 32 1 for a random one
Example:
distributed_cookie=RPVTFCbk9z3m7gRMTUghkjNwP4Hbx4JL
Comment out listener.http.internal and add listener.http.external = 0.0.0.0:8087 if you want to listen on all interfaces for all IPs
Example:
listener.http.external = 0.0.0.0:8098
Do the same change to listener.protobuf.internal
Example:
listener.protobuf.external = 0.0.0.0:8087
Set the storage backend
Example:
storage_backend = leveldb
Enable searching by setting
search = on
Optionally Create a environment file with the riak bin path and ulimit set
cat <<EOM > riak2.env
export PATH=$HOME/src/riak/rel/riak/bin:$PATH
ulimit -n 4096
EOM
. riak2.env
riak start
sleep 5
riak-admin test