Skip to content

Instantly share code, notes, and snippets.

View bcg's full-sized avatar

Brenden Grace bcg

View GitHub Profile
@bcg
bcg / riak-bucket_importer-crash.txt
Created March 15, 2012 13:03
Riak Crask During Import
# /flume/profiles contains 40 million json documents. I successfully loaded 1 million of these same
# documents earlier.
$ sudo riak attach
Attempting to restart script through sudo -u riak
Attaching to /tmp/riak/erlang.pipe.1 (^D to exit)
([email protected])1> code:add_pathz("/tmp"), l(bucket_importer).
{module,bucket_importer}
@bcg
bcg / app.config
Created March 14, 2012 13:23
Current LevelDB Riak Config
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[
%% Riak Core config
{riak_core, [
%% Default location of ringstate
{ring_state_dir, "/riak/ring"},
%% http is a list of IP addresses and TCP ports that the Riak
%% HTTP interface will bind.
@bcg
bcg / basho_bench out
Created March 13, 2012 18:34
basho_bench test crashes
WARN: No data for op: {get,get}
=ERROR REPORT==== 13-Mar-2012::10:10:49 ===
** Generic server <0.111.0> terminating
** Last message in was {req_timeout,#Ref<0.0.7.28998>}
** When Server state == {state,{10,32,36,92},
8087,false,false,undefined,undefined,
{[],[]},
1,[],infinity,100}
** Reason for termination ==
@bcg
bcg / app.config
Created March 12, 2012 14:50
basho_bench failure
~/basho_bench$ grep '{pb_' /etc/riak/app.config
{pb_ip, "10.32.36.92" },
{pb_port, 8087 },
%% {pb_backlog, 64},
~/basho_bench$
@bcg
bcg / FIX
Created March 9, 2012 13:16
bash_bench build error
sudo apt-get install erlang-parsetools
@bcg
bcg / curl
Created March 7, 2012 14:05
Riak all_nodes_down
$ curl -v -d 'this is a test' -H "Content-Type: text/plain" http://10.32.36.92:8098/riak/test
* About to connect() to 10.32.36.92 port 8098 (#0)
* Trying 10.32.36.92... connected
* Connected to 10.32.36.92 (10.32.36.92) port 8098 (#0)
> POST /riak/test HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: 10.32.36.92:8098
> Accept: */*
> Content-Type: text/plain
> Content-Length: 14
@bcg
bcg / State
Created January 17, 2012 20:44
State System
An app, "counter" is registered in the DB:
counter.starts = hourly
counter.depends = {"adx": hourly, "retarget": hourly}
counter.timeout = 6000 (seconds)
counter.host = tr-oddjob-dal-01
Also app, "bigcounter":
# bcounter.starts = weekly (might be unnecessary)
@bcg
bcg / core.clj
Created December 23, 2011 15:24
Clojure Zookeeper
(ns playbook.core
(:use compojure.core
playbook.views.index
[hiccup.middleware :only (wrap-base-url)]
[zookeeper :as zk])
(:require [compojure.route :as route]
[compojure.handler :as handler]))
(defroutes main-routes
(GET "/" [] (index-page))
@bcg
bcg / em-loop.rb
Created September 1, 2011 12:54
EM Loop
items = [1,2,3]
(looper = proc {
item = items.pop
if item
...
EM.next_tick(looper)
end
}).call
var fs = require('fs'),
router = require('choreographer').router();
Conductor = function() {
this.router = router;
this.services = [];
this.controllers = [];
this.requireEach('controllers', function(name, r) {
controller = new r.Controller(options);
this.addController(name, controller);