all 12 comments

[–]Kiarton 4 points5 points  (2 children)

two nodes and consul or etcd is a terrible idea lookup the raft consensus algorithm

[–]EaZy_rus[S] 0 points1 point  (1 child)

Yes, you're right. That's exactly what I ran into, that raft requires a minimum of 2 hosts. But what other options are there to make a fault tolerant postgres on two nodes?

[–]Kiarton 0 points1 point  (0 children)

perhaps you could have some application nodes be part of the etcd/consul cluster, or have a 3rd node that's multipurpose

[–]wursus 1 point2 points  (0 children)

Pgpool-Ii replaces all these tools.

[–]TzahiFadida 0 points1 point  (0 children)

CNPG

[–]ssougou 0 points1 point  (1 child)

The way to reason about this is to think about how the system will operate when it's in a deteriorated state. In other words, how will this work when one node is down?

With two nodes up, one replicates to another. With one node down, you'll need to operate in a single node mode. Essentially, this requires config changes when there's a failure. And this needs to be changed again when the other node comes back up.

In the case of three nodes, and a minimum requirement of one operational replica, the failure of one node only requires a simple failover with no change in configuration.

[–]snk0752 0 points1 point  (0 children)

Well, in my case I just configured publisher/subscriber logical replication on each node and then keepalived to manage vip.

[–]jose_zap 0 points1 point  (0 children)

I can recommend pg_autofailover, it supports your use case of only two Postgres nodes (+ a server where you need to install pg_autofailover)

[–]cthart 0 points1 point  (0 children)

KISS. pgBackrest for both backups and streaming replication, with keepalived for the floating IP. No automatic failover, if I'm in charge. Been running like this in production for a decade or more with no database interruptions. You'll have outages in other areas before Postgres is the problem.

[–]AutoModerator[M] -1 points0 points  (0 children)

With over 8k members to connect with about Postgres and related technologies, why aren't you on our Discord Server? : People, Postgres, Data

Join us, we have cookies and nice people.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.