Skip to content

Instantly share code, notes, and snippets.

@gburd
Forked from micrypt/gist:1048924
Created February 8, 2012 17:46
Show Gist options
  • Save gburd/1771583 to your computer and use it in GitHub Desktop.
Save gburd/1771583 to your computer and use it in GitHub Desktop.
Riak Quick Start from GitHub
# Install Erlang
$ sudo apt-get install autoconf
$ curl -O https://raw.github.com/dreverri/kerl/master/kerl; chmod a+x kerl
$ ./kerl build R14B04 r14b04
$ ./kerl install r14b04 /opt/erlang/r14b04
$ . ~/.kerl/installs/r14b04/activate
# Build Riak from source
$ git clone git://github.com/basho/riak.git
$ cd riak
# If you'd like to pick a version tag now's the time
$ git checkout riak-1.1.1
# Now essentially a `make all`
$ ./rebar get-deps
$ ./rebar compile
# Now setup a "development" cluster of nodes to run on this same host
$ make devrel
# Start dev nodes
$ cd dev
# Start each node in a script: for i in {1..3}; do ./dev$i/bin/riak start; done;
# or by hand and one at a time
$ dev1/bin/riak start
$ dev2/bin/riak start
$ dev2/bin/riak start
# OPTIONAL: If you'd like you could start a node up and remain in the Erlang console by:
$ dev3/bin/riak console
# Check that they are running
$ ps -ef | grep beam
# Ping the nodes to make sure they are alive
# for i in {1..3}; do ./dev$i/bin/riak ping; done;
$ dev1/bin/riak ping
$ dev2/bin/riak ping
$ dev3/bin/riak ping
# View the cluster status before joining nodes (each will be a separate "cluster" of 1 node at this point)
$ dev1/bin/riak-admin ring_status
$ dev1/bin/riak-admin member_status
# Initialize cluster
# for i in {2..3}; do ./dev$i/bin/riak-admin join dev1@127.0.0.1; done;
$ dev2/bin/riak-admin join dev1@127.0.0.1
$ dev3/bin/riak-admin join dev1@127.0.0.1
# View the cluster status after joining nodes
$ dev1/bin/riak-admin ring_status
$ dev1/bin/riak-admin member_status
# Give the HTTP/REST API a try
$ curl http://localhost:8098/riak/test/test -XPUT -d 'hello' -H 'content-type: text/plain'
$ curl http://localhost:8098/riak/test/test
hello
$ curl http://localhost:8098/riak/test/test -XDELETE
not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment