Re: Configuration of django with master slave replication Postgres

From: Prince Pathria <prince(dot)pathria(at)goevive(dot)com>
To: soumitra bhandary <soumitra(dot)bhandary(at)hotmail(dot)com>
Cc: Thomas Poty <thomas(dot)poty(at)gmail(dot)com>, "shreeyansh2014(at)gmail(dot)com" <shreeyansh2014(at)gmail(dot)com>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Configuration of django with master slave replication Postgres
Date: 2019-04-04 12:40:13
Message-ID: CAON0Dax5KW+fKmRUyNq9y2y9b59J9fH_vx3HMwRAt460OX5GkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Soumitra,
In pgpool-II you can configure watchdog mode, so if one pgpool fails the
other node of pgpool gets the VIP so that no change is required on client
side.
Can you show you django dsn config once?
I'm assuming you can do same with pgpool, " Even for that reason in django
I have to configure dsn like that so that it can automatically switch to
other node if one node is not reachable." If you switch your dsn IPs and
ports with 2 of pgpool node(if one pgpool fails dsn will switch to other
pgpool node).

Happy to help :)
Prince Pathria Systems Engineer Evive +91 9478670472 goevive.com

On Wed, Apr 3, 2019 at 5:47 AM soumitra bhandary <
soumitra(dot)bhandary(at)hotmail(dot)com> wrote:

> Hi Prince,
>
> Can you please share me the steps to set up pgpool. Also if I use single
> pgpool that could led to the single point failure. Even for that reason in
> django I have to configure dsn like that so that it can automatically
> switch to other node if one node is not reachable. How to do that??
>
> Sent from my iPhone
>
> On 03-Apr-2019, at 2:10 AM, Prince Pathria <prince(dot)pathria(at)goevive(dot)com>
> wrote:
>
> PgPool-II is very much suitable for your case. It will distribute your
> read queries on master and slaves + automatic master switch detection +
> connection pools.
>
> Happy to help :)
> Prince Pathria Systems Engineer Evive +91 9478670472 goevive.com
>
>
> On Tue, Apr 2, 2019 at 5:52 PM Thomas Poty <thomas(dot)poty(at)gmail(dot)com> wrote:
>
>> As you are using pg 9.5, these links may help :
>>
>>
>> https://severalnines.com/blog/postgresql-load-balancing-using-haproxy-keepalived
>> https://clusterlabs.github.io/PAF/
>>
>> Le mar. 2 avr. 2019 à 13:50, soumitra bhandary <
>> soumitra(dot)bhandary(at)hotmail(dot)com> a écrit :
>>
>>>
>>> Hi
>>> Does anyone have any idea with django how to configure multiple dsn that
>>> will automatically switch to new Postgres master host in case of failover
>>> happens to previous master and auto promotion of new master is done with
>>> repmgr.
>>>
>>>
>>> My configuration is as below
>>>
>>> Master and asynchronous slave node . Repmgrd is configured to take care
>>> of autofailover and promotion of new master node.
>>>
>>> But from application side with django how to make datasource so that it
>>> automatically switches to new master node in case of failover.
>>> Please share the steps.
>>>
>>>
>>> Sent from my iPhone
>>>
>>>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Prince Pathria 2019-04-04 13:06:36 Re: Configuration of django with master slave replication Postgres
Previous Message Johannes Truschnigg 2019-04-04 11:36:57 Re: archive_command options?