distributed locking thesis project
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Fix issue with storing tuples in ets backend Dec 14, 2012
README.md Update README: Add admin commands Jul 24, 2012
rebar Initial commit May 30, 2012



Distributed consensus service focused on consistency

Quick start

Get dependencies and compile the project

$ make

Create a release in "rel" folder

$ make rel

Start and open in console mode

$ rel/warlock/bin/warlock console


warlock uses "ets" based storage backend by default. It can be configured to use other backends such as redis (driver included).

It supports two types of command

  • Cluster (clu): runs the command on the cluster
  • Local (loc): runs the command on the connected node

For example, set and get commands can be run as

(warlock@> war_server:x(clu, [set, key, value]).

(warlock@> war_server:x(loc, [get, key]).

The format is server:x(LOCATION, COMMAND)

Development cluster

warlock can be tested by creating a 3 node dev cluster,

$ make devrel

This creates 3 nodes in the dev folder.

Starting the cluster (start the 3 nodes and connect them),

$ bin/dev_start.sh

Run commands on the cluster by running commands on any of the 3 nodes.

$ dev/dev1/bin/warlock attach
Attaching to /tmp//home/user/warlock/dev/dev1/erlang.pipe.1 (^D to exit)

(warlock1@> war_server:x(clu, [set, key, value]).

(warlock1@> [Quit]

$ dev/dev2/bin/warlock attach
Attaching to /tmp//home/user/warlock/dev/dev2/erlang.pipe.1 (^D to exit)

(warlock2@> war_server:x(loc, [get, key]).

(warlock2@> [Quit]

Admin commands

Join cluster: used to join the cluster when all the nodes in the cluster have the same data.

Cluster size increases.

$ warlock-admin join <seed-node>

$ warlock-admin join warlock1@

Replicate and join cluster: used when the cluster is running and we need to add a new node without affecting the cluster.

Cluster size increases.

$ warlock-admin repl <seed-node>

$ warlock-admin repl warlock1@

Replace: replace an existing node in the cluster.

Cluster size remains same.

$ warlock-admin replace <target-node> <seed-node>

$ warlock-admin replace warlock3@ warlock1@

Remove: remove given node from the cluser

Cluster size decreases

$ warlock-admin remove <node>

$ warlock-admin remove warlock3@

Leave: leave the cluster

Cluster size decreases

$ warlock-admin leave