# Clustering configuration

The following configuration items define how Liberator participates in a cluster.

Want to know more about clustering? [See here](liberator-clustering.md).

**📌 NOTE**\
"_this Liberator_" means the Liberator for which you are defining the configuration. "_this node_" means the cluster node that this Liberator represents.

## add-cluster-node

`add-cluster-node` identifies a Liberator in the cluster.

**💡 TIP**\
For more about how to use `add-cluster-node`, see [Clustering Liberators without the Caplin Deployment Framework](liberator-set-up-a-cluster-of-liberators.md#clustering-liberators-without-the-caplin-deployment-framework) in How can I.. [Set up a cluster of Liberators](liberator-set-up-a-cluster-of-liberators.md).

**Syntax:**

```
add-cluster-node
   xref:cluster-addr[cluster-addr] [string]
   xref:cluster-port[cluster-port] [integer]
end-cluster-node
```

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `<a name="cluster-addr"></a>cluster-addr` | string | `127.0.0.1` | The network interface address or hostname of the cluster node. In the [Caplin Platform Deployment Framework](../deployment-framework/index.md), the configuration macros `LIBERATOR${THIS_LEG}_HOST` and `LIBERATOR${OTHER_LEG}_HOST` specify the `cluster-addr` values. Clustering is used in the Deployment Framework to support failover capability. You normally use the [`./dfw hosts`](../deployment-framework/cdf-the-deployment-framework-command-utility-dfw.md#hosts) command to set up the hostnames in the macros. See [Configuring server hostnames](../deployment-framework/cdf-set-up-server-failover-capability.md#configuring-server-hostnames) in How can I... [Set up server failover capability](../deployment-framework/cdf-set-up-server-failover-capability.md), and [Change server hostnames](../deployment-framework/cdf-change-server-specific-configuration.md#change-server-hostnames) in How can I ... [Change server-specific configuration](../deployment-framework/cdf-change-server-specific-configuration.md). Also see Deployment Framework [Configuration macros and items](../deployment-framework/cdf-configuration-macros-and-items.md). |
| `<a name="cluster-port"></a>cluster-port` | integer | `2333` | The network port number of the cluster node. This port is used for cluster-related communication between the Liberator and the other Liberators in the cluster. In the [Caplin Platform Deployment Framework](../deployment-framework/index.md), the configuration macros `LIBERATOR${THIS_LEG}_CLUSTER_PORT` and `LIBERATOR${OTHER_LEG}_CLUSTER_PORT` specify the `cluster-port` values. See [Clustering Liberators in the Caplin Deployment Framework](liberator-set-up-a-cluster-of-liberators.md#clustering-liberators-in-the-caplin-deployment-framework) in How can I ... [Set up a cluster of Liberators](liberator-set-up-a-cluster-of-liberators.md). Also see Deployment Framework [Configuration macros and items](../deployment-framework/cdf-configuration-macros-and-items.md). |

## cluster-cache-request-objects

`cluster-cache-request-objects` specifies, when set to `TRUE`, that this Liberator is to automatically request (subscribe to) the objects that the other Liberators in the cluster request.

**📌 NOTE**\
If you set this option to `TRUE` for one Liberator, make it `TRUE` for all the other Liberators in the cluster. Then all the Liberators will request (and cache) an object when one of them requests it.

**Syntax:** `cluster-cache-request-objects TRUE`

**Type:** boolean

**Default value:** `FALSE`

## cluster-cache-source-routing

`cluster-cache-source-routing` specifies, when set to `TRUE`, that this Liberator is to request objects from the same DataSource application instance (Transformer or Integration Adapter) as other Liberators in the cluster that request those objects. Setting this item enables [Intelligent Source Routing](liberator-clustering.md#intelligent-source-routing).

**📌 NOTE**\
If you set this option to `TRUE` for one Liberator, make it `TRUE` for all the other Liberators in the cluster. Then all the Liberators will share information about which DataSource application an object was requested from.

Enabling cluster cache source routing can have two advantages. Firstly it minimises the load on the Transformers/Integration Adapters because they aren’t all serving up the same objects. Secondly it minimises the bandwidth used on the network connecting the Transflormers/Integration Adapters to the Liberators, as each update is only sent by a single Transformer/Integration Adapter - this can be a significant advantage if the Transformers/Integration Adapters are connected to the Liberators over a WAN.

**Syntax:** `cluster-cache-source-routing TRUE`

**Type:** boolean

**Default value:** `FALSE`

There are situations where Intelligent Source Routing may not be enforced:

* If two Liberators both make an initial request for an object at around the same time, there may not be enough time for the Liberator that first received the request to tell the second Liberator which DataSource application instance to request the object from; the second Liberator may already have requested the object from a different DataSource application instance.
* Intelligent Source Routing may not always be maintained in failover situations. For example, if multiple Liberators are receiving updates from an Integration Adapter that subsequently goes down, they will failover to another Integration Adapter. But they may each failover to a different Adapter and after this they will continue to receive updates for existing subscriptions from their respective new Adapters. However, after the failover, any _new_ subscriptions will be subject to Intelligent Source Routing.

## cluster-heartbeat-slack-time

`cluster-heartbeat-slack-time` When this Liberator doesn’t receive an expected cluster heartbeat (see [cluster-heartbeat-time](#cluster-heartbeat-time)) from another Liberator in the cluster, it waits `cluster-heartbeat-slack-time` seconds before disconnecting from the cluster and trying to reconnect to it.

Unlike `cluster-heartbeat-time`, the value of `cluster-heartbeat-slack-time` is not compared by the Liberators in the cluster.

**Syntax:** `cluster-heartbeat-slack-time <slack-time-in-seconds>`

**Type:** integer

**Default value:** `5` seconds

## cluster-heartbeat-time

`cluster-heartbeat-time` specifies the time in seconds between each cluster heartbeat. The Liberators forming a cluster exchange heartbeat messages at regular intervals, allowing each of them to check that all the others are still present. If the cluster heartbeat times out, this Liberator waits [cluster-heartbeat-slack-time](#cluster-heartbeat-slack-time) and then disconnects from the cluster and tries to reconnect to it.

When all the Liberators in the cluster have initially connected, they compare their `cluster-heartbeat-time` values and use the lowest.

**📌 NOTE**\
In the [Caplin Platform Deployment Framework](../deployment-framework/index.md), you use a configuration macro `LIBERATOR_CLUSTER_HEARTBEAT_TIME` to specify Liberator’s `cluster-heartbeat-time`. See [Clustering Liberators in the Caplin Deployment Framework](liberator-set-up-a-cluster-of-liberators.md#clustering-liberators-in-the-caplin-deployment-framework) in How can I ... [Set up a cluster of Liberators](liberator-set-up-a-cluster-of-liberators.md), and Deployment Framework [Configuration macros and items](../deployment-framework/cdf-configuration-macros-and-items.md).

**Syntax:** `cluster-heartbeat-time <heartbeat-time-in-seconds>`

**Type:** integer

**Default value:** `15` seconds

The minimum allowed value is 1 second.

## cluster-index

`cluster-index` specifies the index number of this cluster node. The index number uniquely identifies this Liberator within the cluster. It states which of the [add-cluster-node](#add-cluster-node) items this node represents. Index numbers start at 0 and correspond to the order of the [add-cluster-node](#add-cluster-node) items in the configuration file.

**📌 NOTE**\
In the [Caplin Platform Deployment Framework](../deployment-framework/index.md), you use a configuration macro `LIBERATOR_CLUSTER_NODE_INDEX` to specify Liberator’s `cluster-index`. See [Clustering Liberators in the Caplin Deployment Framework](liberator-set-up-a-cluster-of-liberators.md#clustering-liberators-in-the-caplin-deployment-framework) in How can I ... [Set up a cluster of Liberators](liberator-set-up-a-cluster-of-liberators.md), and Deployment Framework [Configuration macros and items](../deployment-framework/cdf-configuration-macros-and-items.md).

**Syntax:** `cluster-index <index-number>`

**Type:** integer

**Default value:** `0`

---

**See also:**

* How can I... [Set up a cluster of Liberators](liberator-set-up-a-cluster-of-liberators.md)
* [Liberator clustering features and concepts](liberator-clustering.md)
