Installing and Configuring ZooKeeper for ThingWorx HA
Apache ZooKeeper is an open source solution for managing synchronization of distributed applications. It provides monitoring and leader election services for ThingWorx nodes. At least three ZooKeeper nodes are recommended in a HA configuration. The number of ZooKeeper instances needs to be an odd number to maintain a quorum, with more instances providing higher availability.
How ZooKeeper is Used
The Connection Servers, ThingWorx Foundation, and Ignite all use ZooKeeper for service discovery. Service discovery is the ability for one application to automatically find instances of another application and react to changes in the available servers.
ThingWorx Foundation uses ZooKeeper for coordination across the ThingWorx nodes. It is used for singleton selection, which is basically the coordination of schedules and timers across the nodes so that no task is run more than once. It is also used for functional coordination to ensure a behavior is controlled across the cluster.
Deploy ZooKeeper
Prior to installing Zookeeper, read and understand all installation documents including documentation for any necessary prerequisite software such as Java. It is important to understand and apply proper settings, including security recommendations. When installing Java for ZooKeeper, PTC recommends disabling client-initiated renegotiation (or jdk.tls.rejectClientInitiatedRenegotiation=true).
Download
You can download ZooKeeper from
http://zookeeper.apache.org/releases.html. For version compatibility information, see the PTC
Release Advisor.
Supported Platforms and Software Requirements
You can find guidelines for deploying ZooKeeper in its Administration Guide at
https://zookeeper.apache.org under
Documentation, which includes supported platforms and required software. For ThingWorx HA, a clustered (multi-server) setup of ZooKeeper should be deployed. Apache refers to a ZooKeeper cluster as an ensemble.
Networking
Client port 2181 must be open between this server and Ignite, the Connection Server, and ThingWorx Foundation. The other ports listed below are required between the individual ZooKeeper nodes.
Port
|
Usage
|
2181
|
Used by ZooKeeper clients to connect to ZooKeeper servers
|
2888
|
Used by peer ZooKeeper servers to communicate with each other
|
3888
|
Used for leader election
|
8080
|
Administration (only if enabled, it can be changed by setting admin.serverPort in zoo.cfg)
|