pgpool HA + repmgr for Postgresql 9.6

1.2k views Asked by At

I'm trying to conifure pgpool in my postgresql environment (2 postgresql servers + 1 pgpool) to do HA while repmgr is responsible for the replication.

I'm getting the next messages in the log :

017-12-03 19:27:07: pid 19033: DEBUG:  pool_flush_it: flush size: 0
2017-12-03 19:27:07: pid 19033: DEBUG:  pool_read: read 103 bytes from     backend 1
2017-12-03 19:27:07: pid 19033: ERROR:  failed to authenticate
2017-12-03 19:27:07: pid 19033: DETAIL:  password authentication failed for user "nobody"
2017-12-03 19:27:07: pid 19033: DEBUG:  find_primary_node: no primary node found
2017-12-03 19:27:08: pid 19033: LOG:  find_primary_node: checking backend no 0
2017-12-03 19:27:08: pid 19033: DEBUG:  SSL is requested but SSL support is     not available 
2017-12-03 19:34:27: pid 22132: ERROR:  unable to read data from DB node 1
2017-12-03 19:34:27: pid 22132: DETAIL:  EOF encountered with backend
2017-12-03 19:28:27: pid 19033: DEBUG:  find_primary_node: no primary node found

The pool_hba.conf :

TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
local   all         all                               trust
host    all         all      127.0.0.1/32             trust
host    all         all      ::1/128                  trust

In postgresql pg_hba.conf I enabled connection from pgpool server :

####pgpool####
host   all all 172.22.13.170/32 trust

1.What can be the problem ?

2.If the repmgr is responsible for the replication should I set the parameter backend_flag to 'DISALLOW_TO_FAILOVER'?

Thanks.

1

There are 1 answers

0
Fredrik On

I'm just getting up to speed on repmgr and pgpool, but I think there are multiple issues here:

1) Your pgpool.conf has some default settings for alive checking, and the user for that is 'nobody', so to get that to work you need to create a pgsql user with that name so that pgpool can query all hosts to find the current master.

2) pgpool executes scripts to change which is the master etc, and that script would normally just run repmgr commands to promote a new primary at failover, so I don't think DISALLOW_TO_FAILOVER is needed.

If repmgr would failover, then the 1 part of you question would make pgpool find which the new master is anyway, but in that case i would have repmgr configure to not failover automatically (since they could fight on who should do what.