Using Riak

I’m setting up Riak to see what it is about. I’m going to follow the Fast Track and keep track of my notes.

Change of gears. The fast track setup up a simple local three node cluster. I want to see Riak in real action on my 4 node cluster in dev. So I’m going to follow the installation instructions.

First step is pretty simple. Run the rpm package to install

sudo rpm -Uvh riak-0.13.0-2.el5.x86_64.rpm 

The one thing I don’t like about rpm package is how the files end up all over the file system. It took me a while to find where the riak command lives. I found you can use rpm to list all the files. I still have to use my own detective work to figure out where the files are. For reference, this command will list all the file installed

rpm -ql riak-0.13.0-2.el5.x86_64

So the riak command is installed to etc/init.d/riak Good to know.

I was able to get it installed. Now I’m going to install the other nodes.

Since I want to have multiple nodes, I need to edit some files and replace the with the ip of the machine.

  • /etc/riak/app.config
  • /etc/riak/vm.args

Note: The instructions say you can use the hostname, but I wasn’t able to do that.

Since I started this host once before, I have to run reip to update the ring file.

sudo /usr/sbin/riak-admin reip riak@ riak@

Attempting to restart script through sudo -u riak 
Backed up existing ring file to "/var/lib/riak/ring/riak_core_ring.default.20110103205917.BAK" 
New ring file written to "/var/lib/riak/ring/riak_core_ring.default.20110103215539"

Add a Second Node to Your Cluster

I installed riak like I did for the first machine and call the join command

sudo /usr/sbin/riak-admin join riak@ 

Add Data

Now that I have the app setup I’ll look at Basic Riak API Operations.