Обсуждение: Repmgr 4, 2 primary servers in cluster

Поиск
Список
Период
Сортировка

Repmgr 4, 2 primary servers in cluster

От
Van Gompel Kurt
Дата:

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.

Re: Repmgr 4, 2 primary servers in cluster

От
Shreeyansh Dba
Дата:

On Wed, Sep 19, 2018 at 11:52 PM Van Gompel Kurt <KVangompel@caami-hziv.fgov.be> wrote:

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.

Re: Repmgr 4, 2 primary servers in cluster

От
Boriss Mejias
Дата:
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.


RE: Repmgr 4, 2 primary servers in cluster

От
Van Gompel Kurt
Дата:

Hello,

 

Thanks for your quick response.

I followed your document and after a new clone of the primary, the standby is in place again.

 

Thanks again!!

 

__________________
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!

 

From: Shreeyansh Dba [mailto:shreeyansh2014@gmail.com]
Sent: donderdag 20 september 2018 9:25
To: Van Gompel Kurt
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Repmgr 4, 2 primary servers in cluster

 

 

On Wed, Sep 19, 2018 at 11:52 PM Van Gompel Kurt <KVangompel@caami-hziv.fgov.be> wrote:

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.