-
Notifications
You must be signed in to change notification settings - Fork 52
Getting Started With Development
Philipp Fehre edited this page Oct 27, 2013
·
2 revisions
Checkout riak_control from github assuming basho/riak_control. Rebar is used to manage the build and dependencies. A Makefile exists to run rebar All of the rebar tasks can be seen with this command:
./rebar -c
Make is configured to get-deps and compile for the default task
- You can also run the test suite for riak_control ( fetches deps and compiles )
make test
- To run all the tests - including the dependencies - rebar can be used directly
./rebar eunit
To integrate riak_control into riak for development you will need to restructure your riak dependencies in the ‘deps’ directory, modify the rel/files/app.config, and start the riak servers
- after checking out riak into a ‘basho’ directory swapout deps/riak_control with a symlink to your development checkout
cd riak/deps && rm -rf riak_control && ln -s ../../riak_control .
- then disable http
30 31 %% http is a list of IP addresses and TCP ports that the Riak 32 %% HTTP interface will bind. 33 %{http, [ {"{{web_ip}}", {{web_port}} } ]},
- enable https ( keys are included in staged release already)
35 %% https is a list of IP addresses and TCP ports that the Riak 36 %% HTTPS interface will bind. 37 {https, [{ "{{web_ip}}", {{web_port}} }]}, 38 39 %% Default cert and key locations for https can be overridden 40 %% with the ssl config variable, for example: 41 {ssl, [ 42 {certfile, "{{platform_etc_dir}}/cert.pem"}, 43 {keyfile, "{{platform_etc_dir}}/key.pem"} 44 ]},
- and turn on riak_control
266 %% riak_control config 267 {riak_control, [ 268 %% Set to false to disable the admin panel. 269 {enabled, true}, 270 271 %% Authentication style used for access to the admin 272 %% panel. Valid styles are 'userlist' <TODO>. 273 {auth, userlist}, 274 275 %% If auth is set to 'userlist' then this is the 276 %% list of usernames and passwords for access to the 277 %% admin panel. 278 {userlist, [{"user", "pass"} 279 ]}, 280 281 %% The admin panel is broken up into multiple 282 %% components, each of which is enabled or disabled 283 %% by one of these settings. 284 {admin, true} 285 ]}
After setting up a staged development release you will want to build them and start, or stop them as needed.
- build a staged dev release including the link to your checkout of riak
make stagedevrel
- starting 4 riak
for i in {1..4}; do; ./dev/dev$i/bin/riak start ; done;
- stopping 4 riak
for i in {1..4}; do; ./dev/dev$i/bin/riak stop ; done;
- joining 3 riak to 1 riak
for i in {2..4}; do; ./dev/dev$i/bin/riak-admin cluster join [email protected] ; done; # to view the plan queue before commiting it # dev/dev1/bin/riak-admin cluster plan dev/dev1/bin/riak-admin cluster commit
Visiting https://user:[email protected]:8091/admin should grant you access to your development Riak_Control