Hi all,
I'm new to pgpool, I'm testing from scratch with version
[postgres@pgpool-01 ~]$ pgpool --version
pgpool-II version 4.6.2 (chirikoboshi)

I'm following the ufficial guide at
https://www.pgpool.net/docs/latest/en/html/example-basic.html.
I started testing native replication mode, I use this configuration in
virtualbox VMs:

server pgppol 192.168.1.118  OEL 9.6
server post01 192.168.1.116  OEL 9.6
server post02 192.168.1.117  OEL 9.6

All VMs can ping/telnet between them, from server pgpool I can connect
to others postgres server via psql:

[postgres@pgpool-01 ~]$ psql -h 192.168.1.116
psql (13.20)
Type "help" for help.

postgres=# \q
[postgres@pgpool-01 ~]$ psql -h 192.168.1.117
psql (13.20)
Type "help" for help.

postgres=#

The relevant parameters in pgpool.conf are the following:

backend_clustering_mode = 'native_replication'

backend_hostname0 = '192.168.1.116'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/PGDATA'
backend_application_name0 = 'server0'

backend_hostname1 = '192.168.1.117'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/PGDATA'
backend_application_name1 = 'server1'

following the guide I sent creation for a database "test" from pgpool:

[postgres@pgpool-01 ~]$ createdb -p 9999 test

but the db has been created only in backend_hostname1.
IN fact pgpool report as down backend_hostname0:


[postgres@pgpool-01 ~]$ psql -h localhost -p 9999
psql (13.20)
Type "help" for help.

postgres=# show pool_nodes;
 node_id |   hostname    | port | status | pg_status | lb_weight |
role   | pg_role | select_cnt | load_balance_no
de | replication_delay | replication_state | replication_sync_state |
last_status_change
---------+---------------+------+--------+-----------+-----------+---------+---------+------------+----------------
---+-------------------+-------------------+------------------------+---------------------
 0       | 192.168.1.116 | 5432 | down   | unknown   | 0.500000  |
replica | replica | 0          | false
   | 0                 |                   |                        |
2025-06-19 16:28:12
 1       | 192.168.1.117 | 5432 | up     | unknown   | 0.500000  |
main    | main    | 0          | true
   | 0                 |                   |                        |
2025-06-19 16:28:12
(2 rows)


But I dont see errors in configuration. If I change the backend
server, switching the IP addresses (to be sure there are not
network or access misconfiguration) the server down results always the
same backend_hostname0, I mean the problem is not in
the postgres server (changing IP does not change the status of show pool_nodes):

new configurazion:

backend_hostname0 = '192.168.1.117'             <<< switched IP
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/PGDATA'
backend_application_name0 = 'server0'

backend_hostname1 = '192.168.1.116'             <<< switched IP
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/PGDATA'
backend_application_name1 = 'server1'

reboot pgpopol and resent show pool_nodes:

[postgres@pgpool-01 ~]$ pgpool stop
2025-06-19 16:44:23.112: main pid 6247: LOG:  stop request sent to
pgpool (pid: 6124). waiting for termination...
.done.
[1]+  Done                    pgpool -n

[postgres@pgpool-01 ~]$ pgpool -n &
[1] 6248
[postgres@pgpool-01 ~]$ 2025-06-19 16:44:31.934: main pid 6248: LOG:
reading status file: 0 th backend is set to down status
2025-06-19 16:44:31.934: main pid 6248: LOG:  reading status file: 1
th backend is set to up status
2025-06-19 16:44:31.935: main pid 6248: LOG:  redirecting log output
to logging collector process
2025-06-19 16:44:31.935: main pid 6248: HINT:  Future log output will
appear in directory "/var/log/pgpool_log".

[postgres@pgpool-01 ~]$ psql -h localhost -p 9999
psql (13.20)
Type "help" for help.

postgres=# show pool_nodes;
 node_id |   hostname    | port | status | pg_status | lb_weight |
role   | pg_role | select_cnt | load_balance_no
de | replication_delay | replication_state | replication_sync_state |
last_status_change
---------+---------------+------+--------+-----------+-----------+---------+---------+------------+----------------
---+-------------------+-------------------+------------------------+---------------------
 0       | 192.168.1.117 | 5432 | down   | unknown   | 0.500000  |
replica | replica | 0          | false
   | 0                 |                   |                        |
2025-06-19 16:44:31
 1       | 192.168.1.116 | 5432 | up     | unknown   | 0.500000  |
main    | main    | 0          | true
   | 0                 |                   |                        |
2025-06-19 16:44:31
(2 rows)

postgres=#

I cannot understand what I'm missing.
Any advice is welcome.

thanks in advance.

MP

Reply via email to