HA History Plugin
1.0
Last update: 2026-10-22 16:46:15
Description
The HA History Plugin is a standalone addon that manages the high availability of the Pandora FMS history database on MySQL. It runs as a service in the environment that manages the cluster, checks the nodes, and keeps the active primary and replica roles aligned. When the main database update is configured, it updates the history database host used by Pandora FMS after a master change, so historical data continues to reach the active node. With replica reconfiguration enabled, it can return a former primary to service as a replica.
Additional information
The addon manages the high availability of the Pandora FMS history database on MySQL. It is intended for environments where the database cluster already exists and the history database is enabled in Pandora FMS. It manages the history database cluster, not the high availability of the Pandora FMS server or console.
The addon keeps the active primary and replica roles aligned, selects a replica for promotion when no node is writable, and demotes extra writable nodes to read-only when more than one is writable. When the main database update is configured, it updates the history database host used by Pandora FMS after a master change. When replica reconfiguration is enabled, it points unhealthy replicas at the elected primary and can return a former primary to service as a replica.
The addon is a controller, not a full cluster manager. It does not create the database cluster or the history database schema. It does not provide quorum, fencing, virtual IP or DNS management, and it does not reconcile divergent writes. It works with asynchronous replication and does not wait for a replica to apply its relay log before promotion. Plan failovers with caught-up replicas and validate data after an unplanned failover.
What it allows you to do
- Keep the Pandora FMS history database host aligned with the active MySQL primary when the main database update is configured.
- Select a read-only replica for promotion when no node is writable.
- Keep one primary when more than one node is writable and demote the others to read-only.
- Reconfigure unhealthy replicas to follow the elected primary when replica reconfiguration is enabled.
- Return a former primary to service as a replica after a failover when replica reconfiguration is enabled.
What it monitors / manages
- Node availability and read-only role.
- Replication thread health and replication delay.
- Active primary identity.
- Replica reconfiguration state.
- History database host used by Pandora FMS.
How it works
The addon periodically checks every configured node. A writable node is treated as the primary; read-only nodes are ranked by replication delay. If no node is writable, the least-delayed replica is selected for promotion. If more than one node is writable, the service keeps one primary and demotes the others to read-only. When replica reconfiguration is enabled, unhealthy replicas are pointed at the elected primary. When the main database update is configured, a master change updates the history database host in Pandora FMS to the active node.
Benefits
- Reduces manual work during a history database failover.
- Keeps Pandora FMS pointed at the active history database after a master change when the main database update is configured.
- Provides a consistent primary and replica role model across the cluster.
- Helps avoid a stale history database configuration after a failover.
Use cases
- Environments that operate a MySQL history database cluster for Pandora FMS.
- Planned maintenance or an unplanned outage of the history database primary.
- Returning a former primary to service as a replica after a failover with replica reconfiguration enabled.
Requirements
- A Pandora FMS installation with the history database enabled.
- A MySQL history database cluster with binary logging enabled and a unique server identifier on every node.
- Network access from the environment executing the addon to every cluster node and to the main Pandora FMS database.
- Database accounts with privileges to read replication state, configure replication, change global read-only settings, reset replica metadata and update the history database host token.
Compatibility
- MySQL 8.0.22 or later.
Limitations
- The addon is a controller, not a full cluster manager: it provides no quorum, fencing, virtual IP or DNS management, and no data reconciliation.
- It works with asynchronous replication and does not wait for a replica to apply its relay log before promotion; validate data after an unplanned failover.
- Automatic replica reconfiguration resets replica metadata and positions the replica at the master's current binary log position.
- Run one instance per history database cluster; there is no distributed lock.