From: Boriss Mejias <bmejias@dcc.uchile.cl>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Repmgr 4, 2 primary servers in cluster
Date: Thu, 20 Sep 2018 13:43:52 +0200
Message-ID: <3c013e09-8535-515f-039f-9bce6d133e45@dcc.uchile.cl> (raw)
In-Reply-To: <F48EBF6F80365A49A0C56AA35618FD59D015DFD556@P00EX001.CAAMI-HZIV.INT>
References: <F48EBF6F80365A49A0C56AA35618FD59D015DFD556@P00EX001.CAAMI-HZIV.INT>
Hello Kurt,
When you promote a standby node to become primary, you cannot just reconnect the
old primary to become a new standby. Both are now separated servers. Both are
primary nodes.
In the context of repmgr, to reuse the old server as a new standby, you will
have to first unregister the old primary with:
repmgr primary unregister --node-id <theid>
More info here: https://repmgr.org/docs/4.1/repmgr-primary-unregister.html
Once it's unregistered you have two choices:
- Either you rebuild a new standby instance on the same server with 'repmgr
standby clone'
- or more complex, but useful for large databases, you manually synchronize the
existing instance with rsync (while doing a base backup), and create the correct
'recovery.conf' file. Then 'repmgr standby register' with the correct information.
Now, if you are interested in a planned switchover, repmgr also has a command
for that:
https://repmgr.org/docs/4.1/performing-switchover.html
I hope that helps
Cheers
Boriss
Van Gompel Kurt wrote on 2018-09-19 20:22:
> Hello,
>
> I'm testing Postgresql 10 with repmgr 4.
>
> I set up a primary with 1 standby server.
>
> Afterwards, I stopped the primary server and promoted the standby server to
> primary (repmgr standby promote -f /etc/repmgr.conf).
>
> Now the command 'repmgr -f /etc/repmgr.conf cluster show' shows 2 primary servers.
>
> How can I turn the 'old primary' server into a standby?
>
> Thanks in advance for your answers?
>
> *__________________
> **Kurt VAN GOMPEL*
> Database Administration
>
> /Infrastructure/
> Tel :*+32 (2) 504.66.13*
> Fax :*+32 (2) 219.34.61*
> Troonstraat 30A 1000 Brussel
> *www.hziv.be**
> **__________________
> *De HZIV, een andere mutualiteit!
>
>
> --------------------------------------------------------------------------------
> Deze e-mail en alle bijlagen zijn vertrouwelijk. Als deze e-mail niet voor u
> bestemd is, vragen wij u dat ons te melden en deze e-mail inclusief alle
> bijlagen te verwijderen.
> Deze e-mail verbindt de HZIV enkel indien hij afkomstig is van een natuurlijke
> persoon die krachtens de wettelijke en/of reglementaire bepalingen werd
> aangesteld om de HZIV te vertegenwoordigen en handelt binnen de perken van zijn
> bevoegdheid.
> ________________________________
>
> Ce courriel et toutes ses annexes sont confidentiels. Si ce courriel ne vous est
> pas destiné, nous vous prions de nous en informer et de le supprimer ainsi que
> ses annexes.
> Ce courriel lie uniquement la CAAMI s'il émane d'une personne physique qui en
> vertu des dispositions légales et/ou réglementaires, a été désignée pour
> représenter la CAAMI et qui agit dans les limites de sa compétence.
> ________________________________
>
> Diese E-Mail und alle Anlagen sind vertraulich. Falls diese E-Mail nicht für Sie
> bestimmt ist, möchten wir Sie bitten uns darüber zu informieren und diese E-Mail
> einschlieβend alle Anlagen zu vernichten.
> Diese E-Mail verbindet nur die HKIV, indem sie von einer natürlichen Person
> stammt, die kraft der gesetzlichen und/oder vorschriftsmäβigen Bestimmungen
> angestellt wurde, um die HKIV zu vertreten und im Rahmen ihrer Zuständigkeit
> handelt.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: bmejias@dcc.uchile.cl
Subject: Re: Repmgr 4, 2 primary servers in cluster
In-Reply-To: <3c013e09-8535-515f-039f-9bce6d133e45@dcc.uchile.cl>
References: <F48EBF6F80365A49A0C56AA35618FD59D015DFD556@P00EX001.CAAMI-HZIV.INT> <3c013e09-8535-515f-039f-9bce6d133e45@dcc.uchile.cl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox