/constructr-zookeeper

This library enables to use ZooKeeper as cluster coordinator in a ConstructR based cluster

Primary LanguageScalaOtherNOASSERTION

ConstructR-ZooKeeper

Build Status

This library enables to use ZooKeeper as cluster coordinator in a ConstructR based node.

ConstructR aims at cluster bootstrapping (construction) by using a coordination service and provides etcd as the default one. By means of this library, you will be able to use ZooKeeper as coordination service instead.

Installation

SBT

You will need to add the following dependency in your build.sbt in addition to the core ConstructR ones:

libraryDependencies += "com.lightbend.constructr" %% "constructr-coordination-zookeeper" % "0.4.0"
Gradle

Add following to build.gradle.

Scala 2.11
compile 'com.lightbend.constructr:constructr-coordination-zookeeper_2.11:0.4.0'
Scala 2.12
compile 'com.lightbend.constructr:constructr-coordination-zookeeper_2.12:0.4.0'

Configuration

Check this section in ConstructR for general information about configuration.

Check reference.conf for ZooKeeper related configuration.

Configuring ZK cluster nodes

The default configuration tries to establish a connection to ZooKeeper on localhost:2181.

Override the constructr.coordination.nodes configuration to specify another ZooKeeper node:

constructr.coordination.nodes = ["10.10.10.10:2181"]

The format per node ip:port.

You are also able to connect to a multi-node cluster by specifying multiple nodes, separated by a comma:

constructr.coordination.nodes = ["10.10.10.10:2181", "10.10.10.11:2181", "10.10.10.12:2181"]

Additionally, comma separated connection string format is supported

constructr.coordination.nodes = "10.10.10.10:2181,10.10.10.11:2181,10.10.10.12:2181"

Testing

Run tests:

$ sbt test