High Availability
Overview
High Availability (HA) mode allows the Intelligence Hub to run across multiple nodes, ensuring continuous operation and failover. Only one node is active at a time; standby nodes are ready to take over if the primary node fails. This is managed through heartbeats and file synchronization.
- Heartbeats: Each node periodically signals its status. If the primary node stops sending heartbeats, a standby node automatically takes over.
- File Synchronization: Configuration files in appData, which includes Connection and Pipeline State Extension caches, are regularly synced to ensure a standby node can seamlessly assume the primary role.
Setup
To setup a primary and secondary hub, use the following steps. More information on the command line arguments is provided in the sections below.
- Install or have available a PostgreSQL server
- Install the primary hub
- Run the create command on the primary hub to initialize the database tables used for synchronization. Note replace node1 with a unique name for the primary. Replace the JDBC URI with your SQL connection settings.
java -cp "intelligencehub-runtime.jar;lib/*" com.highbyte.intelligencehub.runtime.HAMain create -n node1Primary -j "jdbc:postgresql://localhost:5432/dbName?user=username&password=password"
- Install the secondary hub
- Copy the
intelligencehub-certificatestore.pksc12from into the appData of the primary hub to the appData of the secondary hub. Sharing the .pkcs12 file allows the secondary hub to decrypt any secrets that are in the configuration. - Launch the primary hub with the start command with the same nodeid used in create . This starts the hub using the database configuration
java -cp "intelligencehub-runtime.jar;lib/*" com.highbyte.intelligencehub.runtime.HAMain start -n node1Primary -j "jdbc:postgresql://localhost:5432/dbName?user=username&password=password"
- Launch the secondary hub with the start command using a new unique nodeid for the secondary
java -cp "intelligencehub-runtime.jar;lib/*" com.highbyte.intelligencehub.runtime.HAMain start -n node2Secondary -j "jdbc:postgresql://localhost:5432/dbName?user=username&password=password"
In the above setup the primary hub takes precedence, meaning if it’s online and running it takes control. The secondary only takes control when the primary is down.
Command Line Usage
Below are details on the command line arguments to configure and start HA. The primary commands are a follows:
create: Initializes the failover service, syncs initial configuration and state files, and sets the node ID as the preferred primary node.- The preferred primary node is always selected as primary when available.
start: Starts a node in HA mode, joining the failover group.help: Displays usage information.
The basic command syntax looks as follows, with the arguments detailed below. It’s best to run these commands from the runtime directory.
java -cp "intelligencehub-runtime.jar;lib/*" com.highbyte.intelligencehub.runtime.HAMain [options] <create|start|help>
| Option | Description | Example Value |
|---|---|---|
-j, --jdbcURI |
JDBC URI for the node (can use environment variables) | jdbc:postgresql://localhost:5432/dbName?user=username&password=passwordenv:URI |
-n, --nodeId |
Unique node ID for the HA instance |
Note that environment variables can be used for the database configuration commands to avoid passing sensitive information on the command line. Below is an example of using an environment variable.
java -cp "intelligencehub-runtime.jar;lib/*" com.highbyte.intelligencehub.runtime.HAMain start -n node1 -j env:URI
Database
Currently, only the PostgreSQL is supported for the database.