Configuring Keepalived health checks for AEM TarMK Cold Standby
This article explains how to configure Keepalived in an Adobe Experience Manager (AEM) TarMK Cold Standby environment to ensure that only the primary Author instance receives user traffic, preventing the standby node from serving requests before manual promotion.
Description description
In AEM Author deployments using TarMK Cold Standby, Keepalived is often used to manage a Virtual IP (VIP) that directs traffic to the active node. By default, many configurations use a simple port check (such as verifying if port 8443 is listening) as the health check for VIP assignment. However, this approach can result in the standby node being considered healthy and eligible to receive traffic, even though it isn’t promoted to primary. This can cause user or API traffic to be routed to the standby node, which isn’t supported until it is explicitly promoted.
Environment
- Adobe Experience Manager (AEM) Author with TarMK Cold Standby
- One primary and one standby (cold standby) Author instance
- Keepalived managing a Virtual IP (VIP) for load balancing
Symptoms
- API or user traffic is observed reaching the standby node before it is promoted to primary
- No specific error messages are logged, but traffic is routed to the standby node unexpectedly
Cause
A health check based only on port availability (such as port 8443) doesn’t distinguish between the primary and standby roles. This allows the standby node to be eligible for the VIP and receive traffic, which isn’t supported in TarMK Cold Standby topologies.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review your current Keepalived health check configuration. If it only checks for port 8443 (For example: using a command like
/usr/bin/nc -w 3 -zv localhost 8443), it isn’t sufficient to determine node role. -
Replace the port check with a custom health check script that validates whether the node is running as the primary Author instance. For example, you can use a marker file or another reliable indicator that is present only on the primary node.
-
Example custom health check script (using a marker file):
bash #!/bin/bash if [ -f /opt/aem/is_primary ] ; then exit 0 else exit 1 fiEnsure that the marker file (For example:
/opt/aem/is_primary) exists only on the primary node. Remove or create this file as part of your manual promotion process. -
Update your Keepalived configuration to use this custom script as the health check for VIP eligibility.
-
During normal operation, ensure the health check script returns success only on the primary node. The standby node shouldn’t pass the health check until it is promoted.
-
For manual promotion:
- When failover is required, stop AEM on the current primary node.
- Promote the standby node to primary by updating its configuration and creating the marker file (For example:
touch /opt/aem/is_primary). - Start AEM on the new primary node.
- The health check script will now succeed, allowing Keepalived to advertise the VIP on the new primary.
- Recreate or reconfigure the standby node as needed for continued high availability.
- Verify that only the active primary node advertises the VIP and receives user traffic by testing access through the VIP after promotion.