autoscale: true build-lists: true slidenumbers: true
An example of how to use Redbug to trace Riak internals, taking as an example an inexplicably failing secondary index range query.
#Map Reduce Delete Instructions
Set allow_strfun true on all nodes:
echo "rpc:multicall([node() | nodes()], application,set_env,[riak_kv,allow_strfun,true])." | bin/riak attach
Insert 15000 keys:
for i in {1..15000}; do curl -XPUT http://127.0.0.1:9000/buckets/test/keys/test$i -H "content-type: text/plain" -d "Data #$i\n"; done
Load 10Mb of data into /tmp/foo:
sudo dd if=/dev/disk0 of=/tmp/foo bs=1m count=10Start loading it into dev1 node
for i in `seq 1 10000`
do curl -XPUT "http://localhost:10018/buckets/food3/keys/ooopp$i" -d@/tmp/foo | require 'sketchup.rb' | |
| # unknown origin or usage rights... | |
| module BR_push_pull | |
| def BR_push_pull.main | |
| model = Sketchup.active_model | |
| selection = model.selection |
Startup the PUT FSM - code
%% @private
init([From, RObj, Options0, Monitor]) ->
BKey = {Bucket, Key} = {riak_object:bucket(RObj), riak_object:key(RObj)},
CoordTimeout = get_put_coordinator_failure_timeout(),
A pass through mechanism exists in the erlang.distribution cuttlefish component where you can pass any arbitrary flag you please down into the generated vm.args file.
Lets demonstrate the mechanism...
Add a new flag into the riak.conf file.
echo "erlang.distribution.net_ticktime=15" >> ./dev1/etc/riak.confkerl build git git://github.com/basho/otp.git otp-16b02-basho otp-16b02-basho
kerl install otp-16b02-basho /erls/otp-16b02-basho
. /erls/otp-16b02-basho/activate
make devrel
In order to clone the TVN application from sourceforge to github I performed the following steps.
rsync -av rsync://tnv.cvs.sourceforge.net/cvsroot/tnv/* .
svn export --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
cp ./cvs2svn-trunk/cvs2git-example.options ./cvs2git.options
vim cvs2git.options
cvs2svn-trunk/cvs2git --options=cvs2git.options --fallback-encoding utf-8
git@github.com:binarytemple/tnv.git tnv-github
git clone git@github.com:binarytemple/tnv.git tnv-github
| #!/bin/bash | |
| for i in {0..10000} | |
| do | |
| uuid=$(uuidgen) | |
| echo ${uuid} | |
| curl -XPUT http://127.0.0.1:8098/types/default/buckets/test/keys/${uuid} -H "Content-Type: application/json" -d "{\"uuid\": \"${uuid}\", \"date\": \"$(date "+%FT%T.%N:Z")\"}" | |
| done |