Setting up Riak to test out, prototype against, develop and use in a general way is extremely easy. Just setup a devrel on your local development machine. This is however limited to certain *nix based operating systems, so Windows as a dev platform is out – but not completely. Get a virtual machine running on Ubuntu, RHEL or some other Linux instance and you’re ready to go. What I’ve put together here is an example of getting a devrel up and running with an Ubuntu Virtual Machine.
Step 1: Get the basic reqs installed.
-
Install Erlang R15B01.
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev git wget http://erlang.org/download/otp_src_R15B01.tar.gz tar zxvf otp_src_R15B01.tar.gz cd otp_src_R15B01 ./configure && make && sudo make install -
Install Riak from source.
curl -O http://downloads.basho.com.s3-website-us-east-1.amazonaws.com/riak/1.3/1.3.1/riak-1.3.1.tar.gz tar zxvf riak-1.3.1.tar.gz cd riak-1.3.1 make rel -
Install 4 Riak nodes to #devrel.
make all make devrel DEVNODES=4 cd dev
Step 2: With each of the nodes, now join and build the Riak cluster.
-
Start each node.
dev1/bin/riak start dev2/bin/riak start dev3/bin/riak start dev4/bin/riak start -
Check to determine that the riak services are running.
ps aux | grep beam -
Add each node to a single node.
dev2/bin/riak-admin cluster join dev1@127.0.0.1 dev3/bin/riak-admin cluster join dev1@127.0.0.1 dev4/bin/riak-admin cluster join dev1@127.0.0.1 -
Set and get the cluster plan.
dev2/bin/riak-admin cluster planNOTE: This plan can be run from any of the instances.
-
Last, commit the cluster plan.
dev2/bin/riak-admin cluster commitNOTE: The commit can also be run from any of the instances.