This article explains how to configure two Domain Servers as a highly available (HA) pair, and how to enable the Grid feature so that two CEP Servers can operate together for redundancy.
Prerequisites
- Two Domain Server VMs are provisioned, each with the meshIQ Platform Domain component installed, and each can reach the other over the network.
Configure Domain High Availability
Configure each Domain VM with its instance ID and the hostname or IP address of its peer. This allows the two Domain Servers to coordinate HA failover.
Replace the Domain HA scripts
On both Domain VMs, replace the existing
start.sh,stop.sh,show.sh, andMONITORING.DOMAIN.shscripts with the versions provided for this configuration. This can be obtained from your consultant, or these scripts might be there already.These updated scripts contain the logic needed to start, stop, check the status of, and monitor a Domain instance that is part of an HA pair.
Set the Domain instance environment variables
On each Domain VM, open
apin_env.shand add the two environment variables. The values differ on each VM, as shown below:# On Domain VM 1 export DOMAIN_INSTANCE=1 export DOMAIN_HOST_NAME=<hostname_or_ip_of_domain_vm_2>
# On Domain VM 2 export DOMAIN_INSTANCE=2 export DOMAIN_HOST_NAME=<hostname_or_ip_of_domain_vm_1>
Each Domain VM must point to its peer, not to itself.
DOMAIN_HOST_NAMEon Domain VM 1 is the address of Domain VM 2, and vice versa.
Enable the CEP Grid
Link CEP1 and CEP2 into a single Grid and connect that Grid to the Domain HA pair configured earlier.
Complete these steps after Domain configuration is complete.
Enable the grid properties on each CEP instance
On each CEP VM, open
node.properties, located in/opt/meshiq/platform/localhost. The grid properties already exist in this file, only need to set their values as shown below.For the CEP1 instance
property server.grid = APGrid property server.grid_enabled = true property server.grid.pri = 0
For the CEP2 Instance
property server.grid = APGrid property server.grid_enabled = true property server.grid.pri = 1
server.gridmust be set to the same value (In this case, it APGrid & can be any value) on both CEP instances so that they recognize each other as members of the same grid.Copy the existing CEP
registry.xmlfile to both Domain VMsLocate the existing
registry.xmlfile in/opt/meshiq/platform/localhost. Copy this file to both Domain VMs, placing it at the following path on each:/opt/meshiq/platform/naming/grid/APGrid
If the naming, grid, or APGrid (or the grid name defined in CEPs
node.propertiesfile) directories do not already exist on a Domain VM, create them manually under/opt/meshiq/platform/namingbefore copying the file.Configure the CEP Server to Use Both Domain VMs
On the CEP VM, open
global.properties, and set the following two properties to the hostnames of Domain VM 1 and Domain VM 2 respectively:Property Value domain.server.urlDomain VM1 hostname domain.server.failover.urlDomain VM2 hostname With this in place, the CEP Server connects to Domain VM 1 by default and automatically fails over to Domain VM 2 if Domain VM 1 becomes unreachable.