Vagrant setup for firing up a centos6 riak cluster
Puppet Ruby Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Vagrant setup for creating a centos6 riak cluster. This vagrant will let you create a riak cluster of N nodes that will automatically be joined together.

For this to work you'll need a CentOS 6 base box added to your Vagrant install with the name centos6, i.e.:

$ vagrant box list

You can grab pre-existing CentOS 6 base boxes of the internet, or roll your own using veewee.

Make sure to grab one with Puppet installed, or install it yourself and then do a vagrant reload. The following will download a puppet enabled CentOS6 base box:

$ vagrant box add centos6

Creating your Riak cluster

$ vagrant up

Sometimes things fail, especially if you're firing off vagrant commands as the cluster is being created. If it fails out just do the following:

$ vagrant destroy -f
$ vagrant up

After your cluster is created SSH into one of the boxes and make sure all your nodes are connected:

$ vagrant ssh riak1
Welcome to your Vagrant-built virtual machine.
[vagrant@riak1 ~]$ riak-nodes
 - riak@
 - riak@
 - riak@

The riak-nodes command does not ship with Riak. It's just a little perl script this vagrant module installs to let you see all the nodes that are connected.

Test Driving Riak

First let's test that we can talk to riak. From your host machine run this curl command:

$ curl

And you should see JSON output like:


Excellent. Now lets add and retrieve some data from Riak. Save the image below as 1.jpg and do the following:

$ curl -XPUT -H "Content-type: image/jpeg" --data-binary @1.jpg

Now go to in your browser and you should see your image.

Alt text

Changing the size of your cluster

By default running vagrant up will create a riak cluster with 3 nodes. To change this edit the first line of code in the Vagrantfile. It looks like:

num_nodes = 3

Changing your storage backend

Riak supports several different storage backends. To be able to use Riak 2i the eLevelDB must be selected as your backend, so that is what the default value is set to in the Vagrantfile. To select a different one just change the following line in the Vagrantfile:

riak_backend = "eleveldb"

All of the available options are listed in the comment above that line, and of course can be found in the link provided.

Riak Control

Riak control has been enabled without security or ssl. You should not use riak control in production without ssl or authentication security enabled.

You can access the riak-control console by visiting