Overview

Below, you will find the “quick start” directions for setting up and
using Riak. For more information, browse the following files:

README: this file

TODO: a list of improvements planned for Riak

LICENSE: the license under which Riak is released

apps/ the source tree for Riak and all its dependencies

doc/

admin.org: Riak Administration Guide

architecture.txt: details about the underlying design of Riak

basic-client.txt: slightly more detail on using Riak

basic-setup.txt: slightly more detail on setting up Riak

basic-mapreduce.txt: introduction to map/reduce on Riak

js-mapreduce.org: using Javascript with Riak map/reduce

man/riak.1.gz: manual page for the riak(1) command

man/riak-admin.1.gz manual page for the riak-admin(1) command

raw-http-howto.txt: using the Riak HTTP interface

Quick Start

This section assumes that you have copy of the Riak source tree. To get
started, you need to:

Build Riak

Start the Riak server

Connect a client and store/fetch data

Building Riak

Assuming you have a working Erlang (R14B02 or later) installation,
building Riak should be as simple as:

$ cd $RIAK
$ make rel

Starting Riak

Once you have successfully built Riak, you can start the server with the
following commands:

$ cd $RIAK/rel/riak
$ bin/riak start

Now, verify that the server started up cleanly and is working:

$ bin/riak-admin test

Note that the $RIAK/rel/riak directory is a complete, self-contained instance
of Riak and Erlang. It is strongly suggested that you move this directory
outside the source tree if you plan to run a production instance.

Connecting a client to Riak

Now that you have a functional server, let’s try storing some data in
it. First, start up a erlang node using our embedded version of erlang:

Clients for Other Languages

Client libraries are available for many languages. Rather than
bundle them with the Riak server source code, we have given them
each their own source repository. Currently, official Riak
client language libraries include:

Testing

To make sure your patch works, be sure to run the test suite in each
modified sub-project, and dialyzer from the top-level project to
detect static code errors.

To run the QuickCheck properties included in Riak sub-projects,
download QuickCheck Mini: http://quviq.com/downloads.htm NOTE: Some
properties that require features in the Full version will fail.

Running unit tests

The unit tests for each subproject can be run with make or
rebar like so:

make eunit

./rebar skip_deps=true eunit

Running dialyzer

Dialyzer performs static analysis of the code to discover defects,
edge-cases and discrepancies between type specifications and the
actual implementation.

Dialyzer requires a pre-built code analysis table called a PLT.
Building a PLT is expensive and can take up to 30 minutes on some
machines. Once built, you generally want to avoid clearing or
rebuilding the PLT unless you have had significant changes in your
build (a new version of Erlang, for example).

Build the PLT

Run the command below to build the PLT.

make build_plt

Check the PLT

If you have built the PLT before, check it before you run
Dialyzer again. This will take much less time than building the
PLT from scratch.