Service partitioning for efficient multi-site ZooKeeper support by the LEADS project
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


ZooFence is a research prototype for consistent service partitioning. This project contains part of the source code we use for our SRDS paper describing our principled approach.

This tutorial has been tested on Ubuntu 12.04.


How to run the code

We recommend that you set up a new project from existing sources in your favourite IDE (e.g., Eclipse).


resources/zkpartitioned.config contains a sample configuration file.

The required configuration parameters are:

  • ZOOKEEPERS: should contain IP:PORT pairs for different ZooKeeper instances; each ZooKeeper instance represents a ZooFence partition.
  • ZKADMIN: should contain an IP:PORT pair corresponding to the administrative ZooKeeper deployment, which is in charge of storing command queues.
  • FLATTENING_FACTOR: controls when flattening operations are performed.
  • REDUCTION_FACTOR: controls how many partitions to remove during a flattening operation.

How to test ZooFence on localhost

  1. Deploy ZooKeeper instances Check the official ZooKeeper documentation for details on how to deploy and start ZooKeeper instances. To deploy multiple instances on localhost, use different "port" and "dir" parameters in the ZooKeeper configuration. e.g.,
    • zookeeper1: ip:, port:2181, dir:/tmp/zookeeper0 (instance 1)
    • zookeeper2: ip:, port:2182, dir:/tmp/zookeeper1 (instance 2)

Note that the instructions below takes these requirements into account.

  1. Configure and start both ZK instances
   tar zxvf zookeeper-3.4.6.tar.gz
   mv zookeeper-3.4.6 zookeeper0
   cp -r zookeeper0 zookeeper1
   cd zookeeper0`
   cat conf/zoo_sample.cfg | sed s/\\/tmp\\/zookeeper/\\/tmp\\/zookeeper0/g > conf/zoo.cfg
   ./bin/ start
   cd ../zookeper1
   cat conf/zoo_sample.cfg | sed s/2181/2182/g | sed s/\\/tmp\\/zookeeper/\\/tmp\\/zookeeper1/g > conf/zoo.cfg
   ./bin/ start
  1. The class SimpleTest acts as simple client for ZooFence. You can launch it with:

    • mvn test -Dtest=SimpleTest


Should you have any questions, please contact or