Installation and Config of Multi Node Riak Cluster

Erlang Installation

The first step of installing the Riak is to install the Erlang R1403

  Installing using source tar ball

i) Install some of the required libraries before installing the erlang

$ sudo yum install gcc glibc-devel make ncurses-devel openssl-devel

ii) Download the source tar ball by using the following command

wget http://www.erlang.org/download/otp_src_R14B01.tar.gz

ii) Then configure and install by using the below commands

tar zxvf otp_src_R14B03.tar.gz
cd otp_src_R14B03
./configure && make && sudo make install

RIAK Installation

1) Some of the libraries required before installing the riak are

i)gcc

ii)gcc-c++

iii)glibc-devel

iv)make

This can be done by using the below command

$ sudo yum install gcc gcc-c++ glibc-devel make

2) Download the source tar ball by using the following command

$ wget http://downloads.basho.com/riak/riak-1.0.2/riak-1.0.2.tar.gz

3) Then install by using the below commands

$ tar zxvf riak-1.0.2.tar.gz
$ cd riak-1.0.2
$ make rel
$ make devrel
$ cd dev/dev1
    Configuration of the Riak node

Change the default IP address 127.0.0.1 to 0.0.0.0 located under http{} in the riak_core section of riak1.0.2/dev/dev1/etc/app.config

{http, [
            {"0.0.0.0", 8091 }
          ]},

Next edit the riak1.0.2/dev/dev1/etc/vm.args file and change the -name to your IP:

 -name riak@127.0.0.1 ==> -name riak@IPaddress
The ip-address is the address of the ec2 instance
     Starting the riak in dev1
bin/riak start

Once this is done the riak is started and the default port is 8091 we can check this by using curl to “http://IPaddress:8091”

Add a Second Node to Your Cluster

Repeat the steps above for another other node on the network. Once the node has started you will use the bin/riak-admin command to have it join the other node in the Riak cluster.

$ dev/dev1/bin/riak-admin join dev1@Ipaddress
Sent join request to dev1@Ipaddress
Advertisements