Riak DB Server Notes

Configuration

# Start Riak.
riak start

# Check node is running. Will return pong if successful.
riak ping

# Check the node can read and write data.
riak-admin test

# Or using curl. Will get a http 200 if working.
curl -v http://127.0.0.1:8098/riak/test

# Verify basic configuration and general health. Also makes recommendations for optimal operation.
riak-admin diag

# Riak cluster member status
riak-admin memeber-status

Reading an object

http://docs.basho.com/riak/1.3.0/tutorials/querying/Basic-Operations/

# Riak default is to read from two replicas unless overridden.

# Retrieve a object called key from a bucket called bucket (if exists).
# A 404 status is returned if the key doesn't exist. 200 status if Ok.
curl -v http://127.0.0.1:8098/riak/bucket/key

Store and delete an object

# Status 201 Created
# If you store a value in a bucket without passing a key name, a new one will be created for you.
# In the post result, the location header will show you the location of the key that stores your data.
curl -v -d 'this is a test' -H "Content-Type: text/plain" http://127.0.0.1:8098/riak/test

# Delete an object
# Either receive 204 no content status or 404 not found status
curl -v -X DELETE http://127.0.0.1:8098/riak/test/testkey

http://docs.basho.com/riak/1.3.0/tutorials/fast-track/Building-a-Development-Environment/

http://docs.basho.com/riak/

http://littleriakbook.com/

http://basho.com/assets/RelationaltoRiak.pdf

Posted in Databases, Databases