In this scenario, an Eclipse Amlen server that has high availability (HA) disabled is now paired with another Eclipse Amlen server to act as its backup. System administrators can configure a pair of servers for high availability by using REST Administration APIs.
You can configure Eclipse Amlen servers for high availability by using REST Administration APIs or by using the Amlen WebUI. For more information about using the Amlen WebUI to configure servers for HA, see Configuring Eclipse Amlen servers as an HA pair by using the Amlen WebUI.
In this scenario, Server A is the primary node and Server B is the standby node in the HA pair. Server A can be a server that has data on it. Any data on Server B will be destroyed.
Important: The following scenario describes changing one server from standby to primary if one of the server is stopped.
- An HA pair of Eclipse Amlen servers are identified as HA1 and HA2. Both are configured
StartupMode: "AutoDetect"
.
- HA1 is active and is the standby server
- HA2 is active and is the primary server
- HA2 is stopped. So, now HA1 is active and is the standby server.
- Next, you stop HA1. Now both HA1 and HA2 are stopped.
- If you restart HA1, you will get a message saying it can't determine the true HA status because HA2 is still down.
- In order to bring HA1 up as the primary with HA2 still stopped, you need to update
StartupMode: "StandAlone"
Do not start a node as StartupMode: "StandAlone"
if another node is already running and is acting as a primary. Doing so could create a split-brain condition, where both nodes act as primary nodes. In this instance, both nodes will go into maintenance mode.
- Optional:
Eclipse Amlen supports user provided TLS credentials for
High Availability Pairing. Providing the credentials prior to creating the HA pair is recommended to avoid
migrating the cluster. See High Availability Pairing: User Provided TLS Credentials.
-
On Server A, configure the primary server for HA by using the Eclipse Amlen REST API POST method.
-
Use the following Eclipse Amlen configuration URI:
http://<admin-endpoint-IP:Port>/ima/v1/configuration/
-
Provide HighAvailability object configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json. Ensure that capitalization and double quotation marks are used as shown.
{
"HighAvailability": {
"Group": "string",
"EnableHA": true,
"StartupMode": "AutoDetect",
"RemoteDiscoveryNIC": "string",
"LocalReplicationNIC": "string",
"LocalDiscoveryNIC": "string",
"DiscoveryTimeout": integer,
"HeartbeatTimeout": integer,
"PreferredPrimary": true
}
}
Where:
- Group
- The group name of the HA pair. The value must be the same on both servers in the pair.
- RemoteDiscoveryNIC
- Specifies the IP address of the NIC that is used for HA discovery on the remote (standby) node in the HA pair.
- LocalDiscoveryNIC
- Specifies the IP address of the NIC that is used for HA discovery on the local (primary) node in the HA pair.
- LocalReplicationNIC
- Specifies the IP address of the NIC that is used for HA discovery on the local (primary) node in the HA pair.
- DiscoveryTimeout
- Specifies the time in seconds that the node attempts to discover the HA pair node.
- The value must be in the range 10-2147483647.
- The default value is 600.
- HeartbeatTimeout
- Specifies the time in seconds to detect that the other node in the HA pair has failed.
- The value must be in the range 1-2147483647.
- The default value is 10.
- Optional:
If Server B is a newly installed server, you do not need to perform this step. If
Server B is not a newly installed server and has been used for messaging services, you
must delete any JMS queues that exist on the server and then clean the store.
-
On Server B, configure the standby server for HA by using the Eclipse Amlen REST API POST method.
-
Use the following Eclipse Amlen configuration URI:
http://<admin-endpoint-IP:Port>/ima/v1/configuration/
-
Provide HighAvailability object configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json. Ensure that capitalization and double quotation marks are used as shown.
{
"HighAvailability": {
"Group": "string",
"EnableHA": true,
"StartupMode": "AutoDetect",
"RemoteDiscoveryNIC": "string",
"LocalReplicationNIC": "string",
"LocalDiscoveryNIC": "string",
"DiscoveryTimeout": integer,
"HeartbeatTimeout": integer,
"PreferredPrimary": false
}
}
-
Stop and then restart both Eclipse Amlen servers. Ensure that you restart server B in production mode.
-
Use the Eclipse Amlen REST API POST method with the following Eclipse Amlen configuration URI:
http://<admin-endpoint-IP:port>/ima/v1/service/restart
Provide configuration data in the payload of the POST method by using the following schema. Ensure that capitalization and double quotation marks are used as shown.
{
"Service": "Server"
}
Tip: As a best practice, restart the standby server first. Then restart the primary to limit the amount of time that the primary spends waiting for the standby to become available.
You can view HA configuration details of the
Eclipse Amlen server by using the
Eclipse Amlen REST API GET method with the following
Eclipse Amlen configuration URI:
http://<admin-endpoint-IP:Port>/ima/v1/configuration/HighAvailability
You can view information about the HA role of the
Eclipse Amlen server by using the
Eclipse Amlen REST API GET method with the following
Eclipse Amlen configuration URI:
http://<admin-endpoint-IP:Port>/ima/v1/service/status/HighAvailability