Skip to content

Instantly share code, notes, and snippets.

@up1
Last active August 29, 2015 14:06
Show Gist options
  • Save up1/052a87878bb2d54c4c4e to your computer and use it in GitHub Desktop.
Save up1/052a87878bb2d54c4c4e to your computer and use it in GitHub Desktop.
Install Riak with Docker
$curl -i "http://127.0.0.1:49162/buckets/test/keys/somkiat" -X PUT -H "Content-type: text/plain" -d "สวัสดี Riak"
HTTP/1.1 204 No Content
Vary: Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Date: Tue, 09 Sep 2014 08:28:06 GMT
Content-Type: text/plain
Content-Length: 0
$docker images | grep riak
hectcastro/riak latest 8f45093c63a8 2 minutes ago 511.8 MB
$DOCKER_RIAK_AUTOMATIC_CLUSTERING=1 DOCKER_RIAK_CLUSTER_SIZE=5 make start-cluster
./bin/start-cluster.sh
Bringing up cluster nodes:
Successfully brought up [riak01]
Successfully brought up [riak02]
Successfully brought up [riak03]
Successfully brought up [riak04]
Successfully brought up [riak05]
Please wait approximately 30 seconds for the cluster to stabilize.
$docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
364d6ea82460 hectcastro/riak:latest "/sbin/my_init --qui 36 minutes ago Up 19 minutes 0.0.0.0:49161->8087/tcp, 0.0.0.0:49162->8098/tcp riak05
5abee49dc788 hectcastro/riak:latest "/sbin/my_init --qui 36 minutes ago Up 19 minutes 0.0.0.0:49159->8098/tcp, 0.0.0.0:49160->8087/tcp riak04
cc335434fd6e hectcastro/riak:latest "/sbin/my_init --qui 37 minutes ago Up 19 minutes 0.0.0.0:49157->8087/tcp, 0.0.0.0:49158->8098/tcp riak03
5573f34fb722 hectcastro/riak:latest "/sbin/my_init --qui 37 minutes ago Up 19 minutes 0.0.0.0:49155->8087/tcp, 0.0.0.0:49156->8098/tcp riak02
70cbc413fbfa hectcastro/riak:latest "/sbin/my_init --qui 37 minutes ago Up 19 minutes 0.0.0.0:49153->8087/tcp, 0.0.0.0:49154->8098/tcp riak01,riak02/seed,riak03/seed,riak04/seed,riak05/seed
$boot2docker init
$boot2docker start
$curl -i "http://127.0.0.1:49158/buckets/test/keys/somkiat"
HTTP/1.1 200 OK
X-Riak-Vclock: a85hYGBgzGDKBVIcFxR36IXwbfyVwZTImMfKIGbWfJYvCwA=
Vary: Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Link: </buckets/test>; rel="up"
Last-Modified: Tue, 09 Sep 2014 08:28:06 GMT
ETag: "7HBC9NQGGUEd6WLBenBHM4"
Date: Tue, 09 Sep 2014 08:31:43 GMT
Content-Type: text/plain
Content-Length: 23
สวัสดี Riak
$git clone https://github.com/hectcastro/docker-riak.git
$cd docker-riak
$make build
$make test-cluster | grep -A6 "ring_members"
"ring_members": [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment