WelcometoRiak.Riakisadistributed,decentralizeddatastoragesystem.Below,youwillfindthe"quick start"directionsforsettingupandusingRiak.Formoreinformation,browsethefollowingfiles:README:thisfileTODO:alistofimprovementsplannedforRiakLICENSE:thelicenseunderwhichRiakisreleased*.sh:variousstartupscriptsriak_demo.escript:demoforabaselevelofRiakfunctionalitydoc/basic-setup.txt:slightlymoredetailonsettingupRiakbasic-client.txt:slightlymoredetailonusingRiakarchitecture.txt:detailsabouttheunderlyingdesignofRiak,andhowthisaffectsapplicationsusingitindex.html:therootoftheedocoutputof'make docs'src/*.erl:thesourceforRiak(it's friendly) config/ *.erlenv: example configuration filesQuick Start---This section assumes that you have copy of the Riak source tree at$RIAK. You should have created this by cloning a repo or expandinga tarball from somewhere.The quick start goes like this:1. Build Riak2. Start the Riak server3. Connect a client and store/fetch data1. Build Riak-Assuming you have a working Erlang (R13 or later) installation,building Riak should be as simple as:$ cd $RIAK$ make2. Start the Riak server - Assuming no errors were generated in thebuild step, $RIAK/config/riak-demo.erlenv and replace all instances of$RIAK with the directory in which $RIAK is installed. For example,change:{riak_heart_command, "(cd $RIAK; ./start-restart.sh $RIAK/config/riak-demo.erlenv)"}.to:{riak_heart_command, "(cd /usr/local/riak; ./start-restart.sh /usr/local/riak/config/riak-demo.erlenv)"}.Then start riak:$ cd $RIAK$ ./start-fresh.sh config/riak-demo.erlenvThe server should start, then background itself, leaving you at acommand prompt.At this point, you can use riak_demo.escript to ensure that Riak isfunctioning:$ ./riak_demo.escript config/riak-demo.erlenvAttempting to connect to 127.0.0.1:9000 with cookie riak_demo_cookie...Connected successfullyLooking for pre-existing object at {riak_demo, "demo"}... No pre-existing object found, creating newStoring object with new value... Written successfullyFetching object at {riak_demo, "demo"}... Fetched successfully Object contained correct valueSUCCESSIf riak_demo prints no "Error: ..." messages, and instead prints"SUCCESS", then Riak is working.3. Connect a client-Assuming no errors were generated during the server start step, asimple client interaction will look like:(remember, $RIAK should be set to the local path to your Riak installation)$ erl -name riaktest@127.0.0.1 -pa $RIAK/ebin -setcookie riak_demo_cookie(riaktest@127.0.0.1)1> %% connect to Riak(riaktest@127.0.0.1)1> {ok, C} = riak:client_connect('riakdemo@127.0.0.1').{ok,{riak_client,'riakdemo@127.0.0.1',"20090722191020-riaktest@127.0.0.1-riakdemo@127.0.0.1-266664"}}riaktest@127.0.0.1)2>%%Createashoppinglistforbreadat/groceries/mineriaktest@127.0.0.1)2>O0=riak_object:new(<<"groceries">>,<<"mine">>,["bread"]).{r_object,<<"groceries">>,<<"mine">>,[{r_content,{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},{{[],[],[],[],[],[],[],[],[],[],[],[],...}}},["bread"]}],[],{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},{{[],[],[],[],[],[],[],[],[],[],[],[],[],...}}},undefined}(riaktest@127.0.0.1)3>%%storethelist(riaktest@127.0.0.1)3>C:put(O0,1).ok(riaktest@127.0.0.1)4>%%retrievethelist(riaktest@127.0.0.1)4>{ok,O1}=C:get(<<"groceries">>,<<"mine">>,1).{ok,{r_object,<<"groceries">>,<<"mine">>,[{r_content,{dict,2,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],...},{{[],[],[],[],[],[],[["X-Riak-Last-Modified",87|...]],[],[],[],...}}},["bread"]}],[{"20090722191020-riaktest@127.0.0.1-riakdemo@127.0.0.1-266664",{1,63415509105}}],{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],...},{{[],[],[],[],[],[],[],[],[],[],[],...}}},undefined}}(riaktest@127.0.0.1)5>%%extractthevalue(riaktest@127.0.0.1)5>V=riak_object:get_value(O1).["bread"](riaktest@127.0.0.1)6>%%addmilktothelist(riaktest@127.0.0.1)6>O2=riak_object:update_value(O1,["milk"|V]).{r_object,<<"groceries">>,<<"mine">>,[{r_content,{dict,2,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},{{[],[],[],[],[],[],[["X-Riak-Last-Modified",87,101,100|...]],[],[],[],[],[],...}}},["bread"]}],[{"20090722191020-riaktest@127.0.0.1-riakdemo@127.0.0.1-266664",{1,63415509105}}],{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},{{[],[],[],[],[],[],[],[],[],[],[],[],[],...}}},["milk","bread"]}(riaktest@127.0.0.1)7>%%storethenewlist(riaktest@127.0.0.1)7>C:put(O2,1).ok(riaktest@127.0.0.1)8>%%findoutwhatelseisinthegroceriesbucket(riaktest@127.0.0.1)8>C:list_keys(<<"groceries">>).{ok,[<<"mine">>]}