Citrix NetScaler HA Failover Playbook
Primary/secondary state split, force failover, config sync failures, and heartbeat loss. NetScaler HA failovers cause connection drops and can result in split-brain if the heartbeat network is partitioned.
Operator's Field Notes
Jeremy Martinez · Incident Commander | Principal Site Reliability Engineer
"NetScaler HA failover is controlled by heartbeats between primary and secondary nodes. When heartbeats stop, the secondary assumes the primary is dead and takes over. The problem: network issues between the nodes can cause heartbeat loss even though both nodes are healthy. That's your split-brain - both nodes start answering for the VIPs."
"The first command is always show ha node - run it on both nodes. You need to see one Primary and one Secondary. If you see two Primaries, force one to secondary immediately. If you see 'UNKNOWN' or 'INIT' state, the HA pairing is broken and needs to be re-established."
First 5 Minutes - Triage
1. Check HA Node Status
# Run on BOTH nodes show ha node # Key fields: # Node State: Primary / Secondary / UNKNOWN # Master State: Primary / Secondary # Failover mode: Enabled # INC State: ENABLED (Incremental sync) # Sync State: SUCCESS / FAILED / IN PROGRESS # Propagation: ENABLED # Last transition: (timestamp of last failover) # Check HA node details show ha node 0 # Local node show ha node 1 # Peer node # Check heartbeat show ns ip | grep NSIP
2. Check Heartbeat and Communication
# Ping the peer's NSIP (management IP) ping PEER_NSIP # Check HA heartbeat counters stat ha node # Key stats: # HA heartbeats sent/received # HA sync failures # HA prop failures # Check if heartbeat VLAN is up show interface # Check network between nodes traceroute PEER_NSIP
3. Check Config Sync Status
# Check sync status show ha node | grep -i sync # Force sync (push config from primary to secondary) force ha sync # Check for config differences show ns runningConfig > /var/tmp/primary.conf # Compare with secondary's running config # Check last sync result show ha files # Shows files pending sync
Recovery Procedures
Force Failover
# Force failover (run on the PRIMARY node) force ha failover # Force a specific node to be primary # On the node you want as primary: force ha failover -force # If failover is stuck, disable/re-enable HA # WARNING: Causes traffic disruption set ha node -haStatus STAYPRIMARY # On desired primary set ha node -haStatus STAYSECONDARY # On desired secondary # Then re-enable normal HA set ha node -haStatus ENABLED
Fix Split-Brain
# URGENT: Two nodes both claiming Primary # 1. Identify which node has the correct/newer config # (Usually the one that was primary before the split) # 2. Force the wrong one to secondary # On the node that should be SECONDARY: set ha node -haStatus STAYSECONDARY # 3. Verify the correct node is primary show ha node # Should show one Primary, one StaySecondary # 4. Re-enable HA on the secondary set ha node -haStatus ENABLED # 5. Force a config sync force ha sync # 6. Verify ARP tables on upstream switches # The switch should have only ONE MAC for each VIP
Re-establish HA Pairing
# If HA pairing is completely broken (UNKNOWN state): # On the intended PRIMARY: add ha node 1 SECONDARY_NSIP # On the intended SECONDARY: add ha node 1 PRIMARY_NSIP # Wait for sync to complete show ha node | grep -i sync # If sync fails, force full sync force ha sync -force # Save config on BOTH nodes save config
Prevention
HA Best Practices
- • Dedicated HA heartbeat network/VLAN
- • Redundant heartbeat paths (network + serial)
- • Matching firmware on both nodes
- • Regular failover testing (quarterly)
- • Config sync verification after every change
Monitoring
- • SNMP trap on HA state changes
- • Monitor heartbeat count via SNMP
- • Alert on sync failures
- • Dashboard showing both nodes' states
- • Regular config backup (full + incremental)