HA Controller

DECOMMISSIONED 2026-07-10. This page describes the custom Python HTTP HA controller (memgraph-ha) that fronted the old 3-node Memgraph Community cluster. That controller and cluster were deleted on 2026-07-10. The live cluster is orchgraph (Raft HA — 3 coordinators + 2 data instances) with no HTTP controller: failover is coordinator-managed and clients connect with a routing driver at neo4j://10.53.1.160:7691. Retained as a design record — see Memgraph HA Cluster Reference (orchgraph).

The HA controller monitors a Memgraph data cluster, detects MAIN/replica state, and exposes a simple HTTP API so clients do not need to track the current MAIN node.

Responsibilities

  1. Discover cluster nodes from MEMGRAPH_URIS.
  2. Periodically query each node for its role (MAIN/REPLICA).
  3. Expose /main returning the current MAIN Bolt URI.
  4. Trigger failover when MAIN is unreachable.
  5. Trigger failback to a preferred node when it recovers.

API

Endpoint Method Description
/status GET Controller health and cluster view
/main GET Current MAIN Bolt URI
/failover POST Demote MAIN, promote replica
/failback POST Promote preferred node back to MAIN

Autofailback

Autofailback is the primary requirement: when the preferred MAIN node returns, the controller automatically re-promotes it and re-registers the other nodes as replicas.

Cluster state lifecycle managed by the controller

Diagram concepts-ha-controller-1

Known Limitations