Riak DB Server Notes


# 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

# 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


# 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

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"

# Delete an object
# Either receive 204 no content status or 404 not found status
curl -v -X DELETE





Posted in Databases, Databases