Skip to content

Instantly share code, notes, and snippets.

Avatar

Drew Kerrigan drewkerrigan

View GitHub Profile
@drewkerrigan
drewkerrigan / options.md
Last active August 29, 2015 13:56
RiakJson Installation Options
View options.md

Build Riak from source

  1. Download a branch of Riak that contains RJ dependencies in rebar.config, and startup changes in reltool.config
  2. Run make relclean && make rel
  3. Start Riak
Pros
  • Least manual commands and configuration
View riakc_pb_preload.config
{mode, max}.
{duration, 10}.
{report_interval,1}.
{concurrent, 10}.
{driver, basho_bench_driver_riakc_pb}.
{key_generator, {int_to_bin_bigendian, {sequential_int, 10000}}}.
@drewkerrigan
drewkerrigan / limits.conf
Created April 22, 2014 18:58
riak limits
View limits.conf
echo "session required pam_limits.so" >> /etc/pam.d/common-session'
@drewkerrigan
drewkerrigan / app.config
Created May 1, 2014 20:26
An example of multiple bitcask backends, one with expiry set.
View app.config
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[
%% Riak Client APIs config
{riak_api, [
%% pb_backlog is the maximum length to which the queue of pending
%% connections may grow. If set, it must be an integer >= 0.
%% By default the value is 5. If you anticipate a huge number of
%% connections being initialised *simultaneously*, set this number
%% higher.
View riak-ts-rfc.md

Riak Time-Series API

Goal

The goal of a time-series API on Riak is to provide a reusable solution to a common problem faced by customers. The problem at a high level is that there is currently no built-in way to fetch more than one Riak object given start and end parameters.

Minimum Features

The API should at minimum expose a way to easily store individual events as well as a way to query for multiple events given start and end times.

@drewkerrigan
drewkerrigan / sg.preload.config
Created November 24, 2014 19:41
Sample config which creates a complex nested map Riak Datatype that can be indexed using Riak Search
View sg.preload.config
{mode, max}.
% Setup:
% curl -i -XPUT http://localhost:8098/search/index/my_index
% riak-admin bucket-type create maps '{"props":{"search_index":"my_index","datatype":"map"}}'
% riak-admin bucket-type activate maps
{duration, 1}.
{concurrent, 1}.
@drewkerrigan
drewkerrigan / inserts.config
Last active August 29, 2015 14:18
Index Benchmarking
View inserts.config
% curl -i -XPUT http://localhost:8098/search/index/my_index
% riak-admin bucket-type create maps '{"props":{"search_index":"my_index","datatype":"map"}}'
% riak-admin bucket-type activate maps
{mode, max}.
{duration, 1}.
{concurrent, 1}.
@drewkerrigan
drewkerrigan / http_search.config
Last active August 29, 2015 14:21
Basho Bench Riak Search Examples
View http_search.config
{mode, max}.
{duration, 1}.
{concurrent, 1}.
{driver, basho_bench_driver_http}.
{key_generator, {int_to_str, {uniform_int, 50000}}}.
{value_generator, {fixed_bin, 10000}}.
@drewkerrigan
drewkerrigan / README.md
Last active September 17, 2015 20:52
Compile relocatable release on Ubuntu
View README.md

Instructions

sudo su ubuntu
sudo -s
apt-get install -y git
git clone https://gist.github.com/94d82c2ac08dfcad488e.git riak_relocatable
cd riak_relocatable
chmod 755 build.sh
./build.sh
View bash-test.sh
result=`curl -o /dev/null -w "time: "%{time_total}" status:"%{http_code} -k -s -H "Authorization: $auth_header" -H "Content-Type: application/octet-stream" -H "Date: $header_date" -XPUT --proxy1.0 http://10.80.83.68:8077 http://sl.basho.com:80$path -T ./files/$filenumber`
echo $result >> stats.txt