Sheikh Wasiu Al Hasib
Sheikh Wasiu Al Hasib

Reputation: 550

How to configure pgpool with repmgr to make node information sync?

I am trying to configure pgpool with postgresql and repmgr. But after configuring that I found it is not working as expected.

When I switchover standby to primary using repmgr it is working expected but at pgpool primary connection info not changing.

My question is that how can I sync repmgr info with pgpool such as switchover, failover etc.?

In the below screenshot I run pcp_watchdog_info but show server1 is leader and server2,server3 is standby.

But at repmgr after switchover new primary is server2 and server3,server4 is standby.

Why pgpool still showing server1 is a leader? Though as per architecture watchdog only monitor pgpool status.

Is there any relation with repmgr primary with pgpool LEADER?

enter image description here

Need expert opinion, thanks in advance.

Upvotes: 0

Views: 945

Answers (1)

Taha Adel
Taha Adel

Reputation: 11

If you are making repmgr handle automatic failover, you need to add another step in follow_command parameter in repmgr.conf file as follow:

follow_command='/usr/bin/repmgr standby follow -f /etc/repmgr/15/repmgr.conf --log-to-file --upstream-node-id=%n && /usr/sbin/pcp_attach_node -w -h 172.16.0.100 -U pgpool -p 9898 -n %n'

Where 172.16.0.100 is the VIP of Pgpool-II cluster.

Why?

Because, when the primary node is unavailable and another standby is promoted to be the new primary, repmgr needs to resync other standby nodes in the cluster to the new primary and it will shutdown the PostgreSQL service before doing this step and this would detach this standby node from the Pgpool-II cluster.

So, you need to attach the node to the Pgpool-II cluster in follow_command.

Upvotes: 1

Related Questions