[pgpool-general: 7685] Re: Virtual IP is not following the Primary Postgres

Tatsuo Ishii ishii at sraoss.co.jp
Wed Sep 8 16:06:15 JST 2021

> Hi all,
> we setup a 3 nodes cluster with PGPool-II version 4.2.3 like described here:
> https://www.pgpool.net/docs/latest/en/html/example-cluster.html
> Tonight the primary node failed for network problems and failover occurred,
> BUT we found that the Virtual IP was moved not on the new Primary Postsgres
> but on the Standby one.
> Since the Virtual IP is used for client connections to the Writable
> Postgres, the clients were actually connecting to a Read-Only instance.
> Shouldn't the Virutal IP get migrated ONLY on the node that has Primary
> Role?

No. You misunderstand what the VIP is assigned to. The VIP is assigned
to the primary Pgpool-II, not to the primary PostgreSQL server.  In
any case your clients can send write query to the VIP.  Pgpool-II
recognizes which instance of PotgreSQL is the primary server and sends
the write query to the PostgreSQL primary server.

You can check which PostgreSQL instance is the primary PostgreSQL by
using "show pool_nodes" command.
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php

More information about the pgpool-general mailing list