#Development
The Riak Explorer project consists of two sub-projects: the Erlang API (this repo), and the front end JS riak-explorer-gui. The GUI is optional; you can run the API as a standalone add-on to Riak.
- Install Erlang
- Install Riak (from pre-built package, or from source)
- Clone
riak_explorer
(this repo) andcd
into it.
These instructions assume that you have Erlang installed, and Riak installed and started.
-
make
- Loads and compiles all dependencies (depends onerl
) -
make rel
- Performs release tasks, createsrel/riak_explorer
, where its executable and config files will be located. -
make stage
- Enables faster development cycles; Only needs to be run once to set up lib and static web symlinks
Riak Control only interacts with the clusters specified in its config file
(riak_explorer.conf
).
By default, it's going to try and connect to a default
cluster, expecting your
local Riak node to have the id [email protected]
. If your Riak's node id is
different (check Riak's riak.conf
file), you will need the change Explorer's
config to point it in the right direction. (For advanced Riak users: also
double-check that Riak's Erlang cookie matches Explorer's cookie.)
-
Verify settings in
rel/riak_explorer/etc/riak_explorer.conf
-
./rel/riak_explorer/bin/riak_explorer start
(orconsole|attach|stop
) - Starts theriak_explorer
Erlang API, as well as the Webmachine web server that will be serving the Ember.js GUI's HTTP and AJAX requests. -
curl localhost:9000/explore/ping
- Test that Explorer is up and running. By default, Explorer listens on port9000
(you can change this inriak_explorer.conf
). -
curl localhost:9000/explore/clusters/default/nodes
- Test to make sure Explorer can connect to the default cluster. You should see a response like{"nodes":[{"id":"[email protected]"}], ...
If the list of nodes comes back empty, make sure Riak is started, and the node id and Erlang cookie are correct.
(work in progress, to be expanded)
First, locate the path to your Riak lib
directory (as well as lib/basho-patches
,
within it). If your Riak
is installed locally from source (or from the Mac OS X app), it will be located
at <path to Riak install>/lib
. If you installed it on a server
OS from package, see the basho-patches section for an idea of where Riak lib/
is installed.
(#TODO - explain where Riak's priv/
is located).
Let's export these locations to variables in your terminal session, to make the
instructions easier. (The instructions below are for a local Mac OS X install
from Riak.app
.)
export RIAK_PATH=/Applications/Riak.app/Contents/Resources/riak-2.1.0
export RIAK_LIB=$RIAK_PATH/lib
export RIAK_PRIV=$RIAK_PATH/priv
The basho-patches
directory will be located within $RIAK_LIB
. This directory
allows hot-loading of custom Erlang modules into Riak, and that's exactly the
mechanism the Explorer API will be using.
-
make riak-addon
-
cp rel/riak-addon/ebin/* $RIAK_LIB/basho-patches/
-
rm -rf $RIAK_PRIV/*
<- are we sure this part doesn't get rid of anything necessary? -
cp -R rel/riak-addon/priv/* $RIAK_PRIV
-
make test
- Recompilessrc
and executes unit tests -
make itest
- Recompilessrc
, executes integration tests (run./rel/riak_explorer/bin/riak_explorer start
first)
For instructions on how to install the front-end GUI (and its dependencies), see the README at riak-explorer-gui.
Thank you for being part of the community! We love you for it.