0

I'm trying to use pgpool to postgres HA.

node_id | hostname | port | status | pg_status | lb_weight | role | pg_role | select_cnt | load_bala nce_node | replication_delay | replication_state | replication_sync_state | last_status_change ---------+----------+------+--------+-----------+-----------+---------+---------+------------+---------- ---------+-------------------+-------------------+------------------------+--------------------- 0 | master | 5432 | up | up | 0.500000 | primary | primary | 1 | false | 0 | | | 2022-05-30 10:33:21 1 | slave | 5432 | up | up | 0.500000 | standby | primary | 0 | true | 419431440 | | | 2022-05-30 10:33:21

In this process, other process is working well, but I got empty value replictation_state and replication_sync_state. And I got high value in replication_delay.

Why those values are empty and high value?

Is there should change values in postgres.conf or pgpool.conf for replication?

In this case, I used 'pg_basebackup -h host -U Repuser -p port -D dir -X stream' for slave

this is pcp_node_info's result master 5432 2 0.500000 up up primary primary 0 none none 2022-05-30 10:42:40 slave 5432 2 0.500000 up up standby primary 419431848 none none 2022-05-30 10:42:40

Sorry to my English Level, Thank you for your help

My version

  • postgres 14.2
  • pgpool 4.3.1
hyungs
  • 1
  • 1

1 Answers1

0

You need to provide application_name in both configurations files - postgresql.conf (primary_conninfo variable) and pgpool.conf for each node.

Also you should check recovery_1st_stage and follow_primary.sh files as there you also find block with application_name. Script are used by pgpool to recover replica (with pcp_recover_node) or promote new master.

After all you can check current value with "select * from pg_stat_replication;" (on master) or "select * from pg_stat_wal_receiver;" (on replica)

More information: https://www.pgpool.net/docs/pgpool-II-4.3.1/en/html/example-cluster.html

Karol Murawski
  • 326
  • 2
  • 10