High availability and disaster recovery¶
This page explains how QubeSight keeps running when a server fails (high availability) and how you bring it back after losing a site (disaster recovery). It also states what the platform does not do and the recovery figures measured in testing. For procedures, see Add cluster nodes and a witness, Set up a disaster-recovery site, Backup and restore and Disaster-recovery drill.
Community Enterprise
High availability and disaster-recovery drills are Enterprise features (ha_cluster, disaster_recovery). Encrypted backups and restore from backup are available in both editions (backup).
Two different problems¶
| High availability | Disaster recovery | |
|---|---|---|
| Protects against | Failure of one server in a site | Loss of every server, or of the whole site |
| Mechanism | A cluster with replicated storage and automatic failover | Backups and the locked store, restored into a new installation |
| Interruption | Seconds to about a minute | Minutes to hours, depending on how much data you reload |
| Data loss | None for buffered paths (see below) | Up to the age of the last backup for configuration; about 12 minutes for activity |
High availability¶
Members and votes¶
A cluster has at least three voting members: two full nodes and a witness, or more full nodes. Every member runs ClickHouse Keeper, etcd and a Redpanda broker, so every member has a vote in each coordination service. The witness has no activity data and serves no users; it only votes.
Automatic failover requires a majority of votes:
| Members | Failures tolerated |
|---|---|
| 1 (single node) | None. Protection is backup and restore. |
| 3 (two full nodes and a witness) | Any one member. |
| 5 | Any two members. Use an odd number of members. |
With only two members, neither side of a broken network link is a majority, and both could believe they are in charge. For this reason the cluster wizard does not let you form a cluster with fewer than three voting members.
What each layer does¶
| Layer | How it stays available |
|---|---|
| Log intake | The virtual IP is held by one full node. keepalived checks the local Vector port (5140) every 3 seconds; after 2 failures the address moves to the other full node. If the web interface on the holder stops answering and another node has both 5140 and 3000 working, the address moves too. It never moves away from the last node that can still receive logs. |
| Kafka buffer | Three Redpanda brokers hold three replicas of every topic. With one broker down, the other two keep the majority and continue. |
| Activity store | Every ClickHouse table is replicated to both full nodes through ClickHouse Keeper. Each node can accept writes; data parts are copied to the other node. |
| Configuration store | PostgreSQL runs under Patroni with one writer and one synchronous standby. When the writer fails, Patroni promotes the standby (in testing within about 20–25 seconds). Applications list all members and always connect to the current writer. |
| Processing | The workers on both full nodes form one Kafka consumer group. When one disappears, the other takes over its partitions. |
| Scheduled jobs | Backups, deliveries, cold-tier runs and similar jobs take a PostgreSQL lock, so exactly one node runs each job; another node takes over when the lock holder is gone. |
| Web interface | Every full node serves the interface and API. Sessions are stored in PostgreSQL, so users stay signed in when the virtual IP moves. All nodes serve the same web certificate. |
What happens when a full node fails¶
sequenceDiagram
participant S as Sources
participant V as Virtual IP
participant N1 as Full node 1
participant N2 as Full node 2
participant W as Witness
N1--xN1: node 1 fails
V->>N2: keepalived moves the address (seconds)
N2->>W: Keeper and etcd keep majority (N2 + W)
N2->>N2: Patroni promotes the PostgreSQL standby
N2->>N2: worker takes over all Kafka partitions
S->>V: senders reconnect, logs land on node 2
In an internal failure test, a full node was killed without warning while Filebeat sent a numbered sequence of events. PostgreSQL moved to the other node in about 20 seconds, ClickHouse writes paused for about 35 seconds, and every event (5,726 of 5,726) was stored exactly once.
When the failed node returns, it rejoins in its previous place and copies what it missed from the cluster. The virtual IP does not move back automatically, so there is no second interruption.
Updates in a cluster¶
Updates are applied on one node and then rolled out to the other full nodes automatically. The interface shows each node's version in Platform → System and Cluster → Cluster. See Cluster operations and the cluster map.
Disaster recovery¶
What you need to recover¶
Two things are enough to rebuild an installation after losing every server:
- The backup location: the locked store (MinIO or S3 with Object Lock) or an SFTP server, on a site that survives the disaster.
- The backup passphrase: the key for configuration backups is derived from it. If you never set one, the default passphrase is used, and anyone who obtains a backup file can open it.
No separate recovery package needs to be kept. The installer restores the keys from the backup location, starts the services, restores the configuration (users, rules, integrations, settings) and loads the last N days of activity from the locked store into ClickHouse. Older activity is read from the locked store directly.
Recovery point (RPO)¶
| Data | Recovery point |
|---|---|
| Activity records in the locked store | About 12 minutes: blocks are exported every 10 minutes, about 12 minutes after arrival. |
| Configuration | The age of the last configuration backup. The default schedule is daily (up to 24 hours); shorten the interval for a smaller RPO. |
| Guardium live rows not yet finalised | Not in the locked store until finalised (up to 36 hours). The next-day Guardium archive brings this activity back. |
| Records still in Redpanda or at the source | Can be re-read if the source still holds them (for example Event Hub or Kinesis retention, Guardium archives). |
Recovery time (RTO)¶
In an internal test, restoring a disaster-recovery server took about 13.5 minutes of pure restore time for 133 tables and about 95 million rows, and 29 minutes from stop to ready including an image rebuild. Your recovery time depends on the number of days you reload into ClickHouse, the hardware and the network to the backup location.
Data and Backup → DR shows a measured RTO and says where the figure comes from: a recorded restore or failover drill (preferred), a full verification of the log backup on the same server, or the automatic PostgreSQL restore test. Only a recorded drill counts as meeting the target.
Cluster-aware restore¶
The backup of every device records its place in the cluster. When you restore a cluster member:
- If the rest of the cluster is still running, the restored server rejoins in its previous place and takes its data from the cluster.
- If all members were lost, the first restored server comes back as the first node with data from the backup; the others are shown as lost until you reinstall and rejoin them.
Limitations¶
- No continuous replication to a DR site. The DR site is rebuilt from backups and the locked store. Activity after the last exported block and configuration changes after the last configuration backup are not recovered.
- Failback is manual. Returning from the DR site to the primary is the same restore procedure in the opposite direction.
- Duplicate notifications. If the primary is still partly running while the DR installation is active, both can send scheduled notifications. Decide which site is active before you start the DR installation.
- A locked store on the same server is lost with the server. For disaster recovery the locked store or the SFTP backup must be on another site.
- SFTP has no deletion lock, and ClickHouse backups to SFTP are always full (not incremental). Restoring SFTP log copies loads one day at a time into ClickHouse memory.
- Plain TCP syslog has no application-level acknowledgement: lines in flight at the moment a node dies can be lost (2 of 6,000 lines in a cloud failure test). Use Filebeat or a sender with a disk queue for zero-loss requirements, and send to the virtual IP rather than to a node address.
- SNMP traps are UDP and are never resent.
- Public clouds do not support the keepalived virtual IP. A cloud high-availability design uses a load balancer instead and is not offered as a marketplace template in this release.
- Ingest TLS (syslog 6514, Kafka 9093) is available in a cluster only.