Participant High Availability
High availability of a participant node is achieved by running multiple participant node replicas that have access to a shared database. Participant node replicas are configured in the Canton configuration file as individual participants with two required changes for each participant node replica:- Using the same storage configuration to ensure access to the shared database. Only PostgreSQL and Oracle-based storage is supported for HA. For Oracle it is crucial that the participant replicas use the same username to access the shared database.
- Set
replication.enabled = truefor each participant node replica.
Participant replication is enabled by default when using supported storage.
Manual trigger of a fail-over
Fail-over from the active to a passive replica is done automatically when the active replica has a failure, but one can also initiate a graceful fail-over with the following command:Load balancer configuration
Many replicated participants can be placed behind an appropriately sophisticated load balancer that will by health checks determine which participant instance is active and direct ledger and admin api requests to that instance appropriately. This makes participant replication and failover transparent from the perspective of the ledger-api application or canton console administering the logical participant, as they will simply be pointed at the load balancer. Participants should be configured to expose an “IsActive” health status on our health HTTP server using the following monitoring configuration:/health if the Participant is currently the active replica. Otherwise, an error will be returned.
To use a load balancer it must support http/1 health checks for routing requests on a separate http/2 (GRPC) server. This is possible with HAProxy using the following example configuration: