Thread: Patroni set up

Patroni set up

From
Raj
Date:
I am looking to DR set up patroni. For 5 node set up

Mumbai: Node 1: postgres+etcd+patroni 
Mumbai: Node 2: postgres+etcd+patroni
Chennai: Node 3: postgres+etcd+patroni 

Mumbai: haproxy+keepalived
Chennai: haproxy+keepalived

Will this work? And I want to know in which node should I take daily backup. Meaning- in which node I should configure pgbackrest backup

Re: Patroni set up

From
kaido vaikla
Date:
Hi, 
Based on my opinion and setups.
I would keep etcd cluster on separate nodes and separate data centre.
Mumbai down means whole pg patroni cluster is down, because you dont have an etcd quorum. And other reasons, why create separet etcd cluster.

Take a backup from leader. Leader donw means no replicas. Replica down does not mean leader down.

br
Kaido

On Wed, 2 Jul 2025 at 10:38, Raj <rajeshkumar.dba09@gmail.com> wrote:
I am looking to DR set up patroni. For 5 node set up

Mumbai: Node 1: postgres+etcd+patroni 
Mumbai: Node 2: postgres+etcd+patroni
Chennai: Node 3: postgres+etcd+patroni 

Mumbai: haproxy+keepalived
Chennai: haproxy+keepalived

Will this work? And I want to know in which node should I take daily backup. Meaning- in which node I should configure pgbackrest backup

Re: Patroni set up

From
"DINESH NAIR"
Date:
Hi, 

In my opinion this 5-node set up is very elaborate and should work , which is distributed different across different seismic zone (across Mumbai (primary DC) and Chennai (DR site))  . Probably below mentioned parameters were factored when designing the system


Thanks 

Dinesh Nair



From: kaido vaikla <kaido.vaikla@gmail.com>
Sent: Wednesday, July 2, 2025 2:28 PM
To: Raj <rajeshkumar.dba09@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Patroni set up
 
You don't often get email from kaido.vaikla@gmail.com. Learn why this is important
Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.
Hi, 
Based on my opinion and setups.
I would keep etcd cluster on separate nodes and separate data centre.
Mumbai down means whole pg patroni cluster is down, because you dont have an etcd quorum. And other reasons, why create separet etcd cluster.

Take a backup from leader. Leader donw means no replicas. Replica down does not mean leader down.

br
Kaido

On Wed, 2 Jul 2025 at 10:38, Raj <rajeshkumar.dba09@gmail.com> wrote:
I am looking to DR set up patroni. For 5 node set up

Mumbai: Node 1: postgres+etcd+patroni 
Mumbai: Node 2: postgres+etcd+patroni
Chennai: Node 3: postgres+etcd+patroni 

Mumbai: haproxy+keepalived
Chennai: haproxy+keepalived

Will this work? And I want to know in which node should I take daily backup. Meaning- in which node I should configure pgbackrest backup

Re: Patroni set up

From
Raj
Date:
Hi Dinesh, now with 5 node which server to take backup

On Wed, 2 Jul 2025, 15:49 DINESH NAIR, <Dinesh_Nair@iitmpravartak.net> wrote:
Hi, 

In my opinion this 5-node set up is very elaborate and should work , which is distributed different across different seismic zone (across Mumbai (primary DC) and Chennai (DR site))  . Probably below mentioned parameters were factored when designing the system

  1. network latency between Mumbai and Chennai
  2. application switch over in case of fail-over and the downtime.

Thanks 

Dinesh Nair



From: kaido vaikla <kaido.vaikla@gmail.com>
Sent: Wednesday, July 2, 2025 2:28 PM
To: Raj <rajeshkumar.dba09@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Patroni set up
 
Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.
Hi, 
Based on my opinion and setups.
I would keep etcd cluster on separate nodes and separate data centre.
Mumbai down means whole pg patroni cluster is down, because you dont have an etcd quorum. And other reasons, why create separet etcd cluster.

Take a backup from leader. Leader donw means no replicas. Replica down does not mean leader down.

br
Kaido

On Wed, 2 Jul 2025 at 10:38, Raj <rajeshkumar.dba09@gmail.com> wrote:
I am looking to DR set up patroni. For 5 node set up

Mumbai: Node 1: postgres+etcd+patroni 
Mumbai: Node 2: postgres+etcd+patroni
Chennai: Node 3: postgres+etcd+patroni 

Mumbai: haproxy+keepalived
Chennai: haproxy+keepalived

Will this work? And I want to know in which node should I take daily backup. Meaning- in which node I should configure pgbackrest backup

Re: Patroni set up

From
"DINESH NAIR"
Date:
Hi Raj, 

By default pgBackRest will take the backup from primary, but we can configure it take from stand by enabling the backup-standby=y.
Hope it answers your question!!


Thanks 

Dinesh Nair



From: Raj <rajeshkumar.dba09@gmail.com>
Sent: Wednesday, July 2, 2025 4:07 PM
To: DINESH NAIR <Dinesh_Nair@iitmpravartak.net>
Cc: kaido vaikla <kaido.vaikla@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Patroni set up
 
You don't often get email from rajeshkumar.dba09@gmail.com. Learn why this is important
Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.
Hi Dinesh, now with 5 node which server to take backup

On Wed, 2 Jul 2025, 15:49 DINESH NAIR, <Dinesh_Nair@iitmpravartak.net> wrote:
Hi, 

In my opinion this 5-node set up is very elaborate and should work , which is distributed different across different seismic zone (across Mumbai (primary DC) and Chennai (DR site))  . Probably below mentioned parameters were factored when designing the system

  1. network latency between Mumbai and Chennai
  2. application switch over in case of fail-over and the downtime.

Thanks 

Dinesh Nair



From: kaido vaikla <kaido.vaikla@gmail.com>
Sent: Wednesday, July 2, 2025 2:28 PM
To: Raj <rajeshkumar.dba09@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Patroni set up
 
Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.
Hi, 
Based on my opinion and setups.
I would keep etcd cluster on separate nodes and separate data centre.
Mumbai down means whole pg patroni cluster is down, because you dont have an etcd quorum. And other reasons, why create separet etcd cluster.

Take a backup from leader. Leader donw means no replicas. Replica down does not mean leader down.

br
Kaido

On Wed, 2 Jul 2025 at 10:38, Raj <rajeshkumar.dba09@gmail.com> wrote:
I am looking to DR set up patroni. For 5 node set up

Mumbai: Node 1: postgres+etcd+patroni 
Mumbai: Node 2: postgres+etcd+patroni
Chennai: Node 3: postgres+etcd+patroni 

Mumbai: haproxy+keepalived
Chennai: haproxy+keepalived

Will this work? And I want to know in which node should I take daily backup. Meaning- in which node I should configure pgbackrest backup

Re: Patroni set up

From
Raj
Date:
No question is when mumbai is down, it will take backup from chennai right..we should configure like dat right. and is there a way where we also have backups always available even if mumbai is down.

On Wed, 2 Jul 2025, 16:37 DINESH NAIR, <Dinesh_Nair@iitmpravartak.net> wrote:
Hi Raj, 

By default pgBackRest will take the backup from primary, but we can configure it take from stand by enabling the backup-standby=y.
Hope it answers your question!!


Thanks 

Dinesh Nair



From: Raj <rajeshkumar.dba09@gmail.com>
Sent: Wednesday, July 2, 2025 4:07 PM
To: DINESH NAIR <Dinesh_Nair@iitmpravartak.net>
Cc: kaido vaikla <kaido.vaikla@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Patroni set up
 
Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.
Hi Dinesh, now with 5 node which server to take backup

On Wed, 2 Jul 2025, 15:49 DINESH NAIR, <Dinesh_Nair@iitmpravartak.net> wrote:
Hi, 

In my opinion this 5-node set up is very elaborate and should work , which is distributed different across different seismic zone (across Mumbai (primary DC) and Chennai (DR site))  . Probably below mentioned parameters were factored when designing the system

  1. network latency between Mumbai and Chennai
  2. application switch over in case of fail-over and the downtime.

Thanks 

Dinesh Nair



From: kaido vaikla <kaido.vaikla@gmail.com>
Sent: Wednesday, July 2, 2025 2:28 PM
To: Raj <rajeshkumar.dba09@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Patroni set up
 
Caution: This email was sent from an external source. Please verify the sender’s identity before clicking links or opening attachments.
Hi, 
Based on my opinion and setups.
I would keep etcd cluster on separate nodes and separate data centre.
Mumbai down means whole pg patroni cluster is down, because you dont have an etcd quorum. And other reasons, why create separet etcd cluster.

Take a backup from leader. Leader donw means no replicas. Replica down does not mean leader down.

br
Kaido

On Wed, 2 Jul 2025 at 10:38, Raj <rajeshkumar.dba09@gmail.com> wrote:
I am looking to DR set up patroni. For 5 node set up

Mumbai: Node 1: postgres+etcd+patroni 
Mumbai: Node 2: postgres+etcd+patroni
Chennai: Node 3: postgres+etcd+patroni 

Mumbai: haproxy+keepalived
Chennai: haproxy+keepalived

Will this work? And I want to know in which node should I take daily backup. Meaning- in which node I should configure pgbackrest backup

Re: Patroni set up

From
kaido vaikla
Date:


On Wed, 2 Jul 2025 at 13:19, DINESH NAIR <Dinesh_Nair@iitmpravartak.net> wrote:
Hi, 

In my opinion this 5-node set up is very elaborate and should work , which is distributed different across different seismic zone (across Mumbai (primary DC) and Chennai (DR site))  . Probably below mentioned parameters were factored when designing the system

  1. network latency between Mumbai and Chennai
  2. application switch over in case of fail-over and the downtime.

Thanks 

Dinesh Nair



If  Mumbai (primary DC) is down then is down pg+patroni on Chennai. etcd quurom is lost
br
Kaido

Re: Patroni set up

From
Raj
Date:
Then what's the right architecture Kaido

On Wed, 2 Jul 2025, 19:22 kaido vaikla, <kaido.vaikla@gmail.com> wrote:


On Wed, 2 Jul 2025 at 13:19, DINESH NAIR <Dinesh_Nair@iitmpravartak.net> wrote:
Hi, 

In my opinion this 5-node set up is very elaborate and should work , which is distributed different across different seismic zone (across Mumbai (primary DC) and Chennai (DR site))  . Probably below mentioned parameters were factored when designing the system

  1. network latency between Mumbai and Chennai
  2. application switch over in case of fail-over and the downtime.

Thanks 

Dinesh Nair



If  Mumbai (primary DC) is down then is down pg+patroni on Chennai. etcd quurom is lost
br
Kaido

Re: Patroni set up

From
Raj
Date:
I want to use as minimum as possible number of nodes. But want to achive quorum, ip rerouting, and if possible read queries on dr and also backup must be available when one site is down


On Wed, 2 Jul 2025, 19:24 Raj, <rajeshkumar.dba09@gmail.com> wrote:
Then what's the right architecture Kaido

On Wed, 2 Jul 2025, 19:22 kaido vaikla, <kaido.vaikla@gmail.com> wrote:


On Wed, 2 Jul 2025 at 13:19, DINESH NAIR <Dinesh_Nair@iitmpravartak.net> wrote:
Hi, 

In my opinion this 5-node set up is very elaborate and should work , which is distributed different across different seismic zone (across Mumbai (primary DC) and Chennai (DR site))  . Probably below mentioned parameters were factored when designing the system

  1. network latency between Mumbai and Chennai
  2. application switch over in case of fail-over and the downtime.

Thanks 

Dinesh Nair



If  Mumbai (primary DC) is down then is down pg+patroni on Chennai. etcd quurom is lost
br
Kaido

Re: Patroni set up

From
kaido vaikla
Date:
Mumbai: Node 1: postgres+patroni
Mumbai: Node 2: etcd

Mumbai: Node 3: postgres+patroni (if you like 3 nodes pg replica)

Chennai: Node 1: postgres+patroni
Chennai: Node 2: etcd

"Delhi": Node 1: etcd

br
Kaido

Re: Patroni set up

From
Venkat Akhil Pavuluri
Date:
Hi Raj,

We recently deployed a similar architecture for one of our clients. The only addition was the configuration of PgBouncer, a lightweight connection pooling mechanism, on all three nodes where PostgreSQL is installed.

Regarding pgBackRest, I recommend using a dedicated backup server if your backup size is large or if you have a longer retention policy. However, if storage and retention are moderate or having any limitations in providing dedicated servers, utilizing the existing HAProxy servers for backups is also a viable and efficient option.
Thanks and regards
Venkat Akhil P
OpenSource DB
Your Trusted Data Partner
https://opensource-db.com/

On Wed, 2 Jul 2025 at 13:08, Raj <rajeshkumar.dba09@gmail.com> wrote:
I am looking to DR set up patroni. For 5 node set up

Mumbai: Node 1: postgres+etcd+patroni 
Mumbai: Node 2: postgres+etcd+patroni
Chennai: Node 3: postgres+etcd+patroni 

Mumbai: haproxy+keepalived
Chennai: haproxy+keepalived

Will this work? And I want to know in which node should I take daily backup. Meaning- in which node I should configure pgbackrest backup