Skip to content

Instantly share code, notes, and snippets.

1) Create table "kvs"
2) Create table "kvs_id_idx"
3) For insert:
a) Insert into kvs (rowid, data blob)
b) Insert into kvs_id_idx (key, rowid)
4) For delete:
a) Iterate across kvs_id_idx
b) Delete kvs where rowid matches
# [ANN] Consul 0.2 Release
We released Consul 0.1 exactly two weeks ago, and today we are releasing 0.2.
This is a very exciting release for a few reasons:
* Release of the Web UI. Consul now ships with an easy to use interface that
gives access to all the key information. We have a live demo running across
3 datacenters here: http://demo.consul.io/
* New read consistency modes. After feedback from the community, we introduced
# jdyer at MacBook-Pro.local in ~/Projects/consul [15:48:45]
$ dig @localhost -p 8600 _sip._udp.service.consul srv
; <<>> DiG 9.10.0-P2 <<>> @localhost -p 8600 _sip._udp.service.consul srv
; (3 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 5926
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
2014/09/12 14:21:07 [DEBUG] http: Request /v1/agent/self (385.106us)
2014/09/12 14:21:07 [DEBUG] http: Request /v1/event/fire/mysql-available (80.68us)
2014/09/12 14:21:07 [DEBUG] consul: user event: mysql-available
2014/09/12 14:21:07 [DEBUG] agent: new event: mysql-available (be9e89d7-e66b-8dbf-6a3e-ac1f64cfbc27)
2014/09/12 14:21:07 [DEBUG] http: Request /v1/event/list?index=1&name=mysql-available (5.50690515s)
2014/09/12 14:21:07 [DEBUG] http: Request /v1/event/list?index=1&name=mysql-available (42.151us)
2014/09/12 14:21:07 [DEBUG] agent: watch handler 'cat >> events.out' output:
The initial observed cluster behavior:
1) Constant churn of nodes between Failed and Alive
2) Message bus saturated (~150 updates/sec)
3) Subset of cluster affected
4) Some nodes that are flapping don't exist! (Node dead, or agent down)
One immediate question is how the cluster remained in an unstable
state. We expect that the cluster should converge and return to
a quiet state after some time. However, there was a bug in the
low level SWIM implementation (memberlist library).

InfoQ: Vault is an online system that clients must request secrets from, what risk is there that a Vault outage causes down time?

Armon: HashiCorp has been in the datacenter automation space for several years, and we understand the highly-available nature of modern infrastructure. When we designed Vault, high availability was a critical part of the design, not something we tried to bolt on later. Vault makes use of coordination services like Consul or Zookeeper to perform leader election. This means you can deploy multiple Vault instances, such that if one fails there is an automatic failover to a healthy instance. We typically recommend deploying at least

@armon
armon / facebook.py
Created May 20, 2011 07:17
Facebook interface to get posts and perform hierarchical user clustering
from collections import defaultdict
from math import sqrt
import httplib2
import json
import re
import threadpool
import threading
from PIL import Image,ImageDraw
ACCESS_TOKEN = "..."
@armon
armon / keybase.md
Created December 5, 2015 23:00
Keybase Authorization

Keybase proof

I hereby claim:

  • I am armon on github.
  • I am armon (https://keybase.io/armon) on keybase.
  • I have a public key ASByRbYLSFAAGnJf0iMdYR0t5U9u5uVjfP8vY6p2s0vFego

To claim this, I am signing this object:

# -*- mode: ruby -*-
# vi: set ft=ruby :
$setup = <<SCRIPT
# Update apt
apt-get update
# Install the things we need to build
apt-get install -y autoconf
apt-get install -y automake
#!/bin/bash
set -e
CONTAINER=`docker run -d ubuntu:precise echo test`
OUTPUT=`docker logs $CONTAINER`
echo \"$OUTPUT\" should be \"test\"
CONTAINER=`docker run -d ubuntu:precise echo test`
sleep 1
OUTPUT=`docker logs $CONTAINER`