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.[sourcecode language=”bash”]
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[/sourcecode] - Install Riak from source.[sourcecode language=”bash”]
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
[/sourcecode] - Install 4 Riak nodes to #devrel.[sourcecode language=”bash”]
make all
make devrel DEVNODES=4
cd dev
[/sourcecode]
Step 2: With each of the nodes, now join and build the Riak cluster.
- Start each node.[sourcecode language=”bash”]
dev1/bin/riak start
dev2/bin/riak start
dev3/bin/riak start
dev4/bin/riak start[/sourcecode] - Check to determine that the riak services are running.[sourcecode language=”bash”]
ps aux | grep beam[/sourcecode] - Add each node to a single node.[sourcecode language=”bash”]
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[/sourcecode] - Set and get the cluster plan.[sourcecode language=”bash”]
dev2/bin/riak-admin cluster plan[/sourcecode]NOTE: This plan can be run from any of the instances.
- Last, commit the cluster plan.[sourcecode language=”bash”]
dev2/bin/riak-admin cluster commit[/sourcecode]NOTE: The commit can also be run from any of the instances.
One thought on “An Ubuntu Riak #devrel”
Comments are closed.