Set up a cluster of Liberators
You can define two or more Liberators as a cluster. Here’s how to do this.
For more about clustering, see Liberator clustering features and concepts.
Clustering Liberators without the Caplin Deployment Framework
Here’s an example of how to configure a Liberator cluster when you’re not using the Deployment Framework. Here we’ve assumed there are just two Liberators in the cluster, but the same approach applies when you’re clustering more.
cluster-index 0 cluster-heartbeat-time 15 cluster-heartbeat-slack-time 5 add-cluster-node cluster-addr <First-Liberators-network-interface-address> cluster-port <First-Liberators-network-port-number> end-cluster-node add-cluster-node cluster-addr <Second-Liberators-network-interface-address> cluster-port <Second-Liberators-network-port-number> end-cluster-node
cluster-index 1 cluster-heartbeat-time 15 cluster-heartbeat-slack-time 5 add-cluster-node cluster-addr <First-Liberators-network-interface-address> cluster-port <First-Liberators-network-port-number> end-cluster-node add-cluster-node cluster-addr <Second-Liberators-network-interface-address> cluster-port <Second-Liberators-network-port-number> end-cluster-node
Here’s an explanation of the configuration items that we’ve used:
-
cluster-index: Uniquely identifies this Liberator in the cluster. Make sure each Liberator in the cluster has a different cluster-index in its configuration file; in this example, the first Liberator has cluster-index 0 and the second has cluster-index 1.Index numbers must start at
0and correspond to the order of theadd-cluster-nodeitems in the configuration file. -
cluster-heartbeat-timeis 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, and take appropriate action if one doesn’t respond. -
cluster-heartbeat-slack-time: When this Liberator doesn’t receive an expected cluster heartbeat from another Liberator in the cluster, it waitscluster-heartbeat-slack-timeseconds before disconnecting from the cluster and trying to reconnect to it. -
add-cluster-node: Eachadd-cluster-nodeitem defines a Liberator in the cluster by its network interface address and port number. You define all the Liberators in the cluster through a set ofadd-cluster-nodeitems. The set must be in ascending order of the Liberators'cluster-indexvalues. You put theadd-cluster-nodeitems in the configuration of every Liberator in the cluster, so each Liberator identifies every node in the cluster, including itself. You can see that in this example, each of the two Liberators' configurations contains the same set of twoadd-cluster-nodeitems.
Clustering Liberators in the Caplin Deployment Framework
The Caplin Deployment Framework, allows you to easily define a two-Liberator cluster for failover purposes. To enable failover, see How can I… Set up server failover capability in the Deployment Framework pages. You set up some configuration macro definitions in the <Framework-root>/global-config/environment.conf file on the primary and secondary server machines.
-
To change the
cluster-heartbeat-time, add the macro definitionLIBERATOR_CLUSTER_HEARTBEAT_TIMEto<Framework-root>/global-config/environment.confdefine LIBERATOR_CLUSTER_HEARTBEAT_TIME <new value>
-
To change the
cluster-heartbeat-slack-timefrom its default, define a value in<Framework-root>/global_config/overrides/servers/Liberator/etc/cluster.confcluster-heartbeat-slack-time <new-value>
-
To change the
cluster-addrsettings in theadd-cluster-nodeconfiguration entries:The configuration macros
LIBERATOR${THIS_LEG}_HOSTandLIBERATOR${OTHER_LEG}_HOSTspecify thecluster-addrvalues. (These macros are defined in<Framework-root>/global_config/hosts-defns.conf)You normally use the
./dfw hostscommand to set up the hostnames in the macros. See Configuring server hostnames in How can I… Set up server failover capability and Change server hostnames in How can I … Change server-specific configuration.Also see Deployment Framework Configuration macros and items.
If you want to set the
cluster-addrvalues directly, edit them in<Framework-root>/global_config/overrides/servers/Liberator/etc/cluster.conf -
To change the
cluster-portsettings in theadd-cluster-nodeconfiguration entries, put new values for the configuration macrosLIBERATOR${THIS_LEG}_CLUSTER_PORTandLIBERATOR${OTHER_LEG}_CLUSTER_PORTin the<Framework-root>/global_config/overrides/servers/Liberator/etc/cluster.conffile.For example:
define LIBERATOR${THIS_LEG}_CLUSTER_PORT ${THIS_LEG}6003 define LIBERATOR${OTHER_LEG}_CLUSTER_PORT ${OTHER_LEG}6003where the value
6003is the new base port number, replacing the default value6002.
| If you want to set up a cluster of more than two Liberators within the Deployment Framework, please contact Caplin Support for advice on how to do this. |
See also:
-
Liberator Features and Concepts: Clustering
-
Reference: Clustering configuration
-
Reference: DataSource peers configuration
-
Reference: Data services configuration
-
Reference: Deployment Framework configuration macros and items