Open TwiN opened 3 years ago
Could you make HA available without usage of a database ?
If we know by advance the endpoint (IP) of all gatus, we could simply list them in the configuration and they can elect a leader by talking to each other. One of known algorithm to do that is Raft https://raft.github.io/
Could you make HA available without usage of a database ?
If we know by advance the endpoint (IP) of all gatus, we could simply list them in the configuration and they can elect a leader by talking to each other. One of known algorithm to do that is Raft https://raft.github.io/
I think an easier/quicker path to HA might be to model it after Prometheus and leverage Alertmanager to de-dupe alerts.
I've only taken a brief look so far but I think the existing custom notification will work with Alertmanager so long as the notification limiter is commented out.
Hi there, I think this issue lost a bit of traction. Is there any other status on this topic, then what is described in this issue?
This feature would allow more than one replica of Gatus with the exact same configuration to coexist by leveraging leader election through the new postgres
storage.type
.Programmatically, this is how I envision it to work:
instance
table in the Postgres database.label
set todefault
, therole
set toLEADER
and thelast_heartbeat
set toCURRENT_TIMESTAMP
.instance
table in the Postgres database for the labeldefault
and the roleLEADER
.last_heartbeat
timestamp is within the past 5 minutes. This 5 minutes shall be defined as time until reelection.During this entire time, both G1 and G2 can read from the database, and therefore handle HTTP requests. The only restriction is that no more than one leader for one label can write at any given time.
The parameter
distributed.label
is optional, and will default to the valuedefault
.Why do we need a label?
This will be needed for #64 -- basically, let's say you wanted to deploy Gatus in 3 isolated environments which all have access to the postgres database, let's call them
alpha
,bravo
andcharlie
. Of course, each environment has their own set of services to monitor.You'd use the
label
to differentiate these environments and allow one leader per environment to push their data in the database, all while allowing each separate environment to be highly available.Requirements:
storage.type
must be setpostgres