0

Need clarification if this is doable. I have successfully ran Postgres with 2 containers namely master and slave. I would like to know if I can run more than one pgpool container ? If yes, is there any specific environment variables i need to set ?

Can I just take the below command and run in another pgpool VM ? My intention is to have a load balancer round robin between the 2 pgpool that connects to the backend of master (rw) and slave (ro).

docker run --detach --rm --name pgpool \
  --network my-network \
  --env PGPOOL_BACKEND_NODES=0:pg-0:5432,1:pg-1:5432 \
  --env PGPOOL_SR_CHECK_USER=customuser \
  --env PGPOOL_SR_CHECK_PASSWORD=custompassword \
  --env PGPOOL_ENABLE_LDAP=no \
  --env PGPOOL_POSTGRES_USERNAME=postgres \
  --env PGPOOL_POSTGRES_PASSWORD=adminpassword \
  --env PGPOOL_ADMIN_USERNAME=admin \
  --env PGPOOL_ADMIN_PASSWORD=adminpassword \
  bitnami/pgpool:latest 
jlim
  • 909
  • 2
  • 12
  • 24
  • It is certainly possible, you can see that the Bitnami PostgreSQL HA chart has support for multiple replicas: https://github.com/bitnami/charts/blob/master/bitnami/postgresql-ha/values.yaml#L573 - I would advise you to use the chart if it is possible. If not you can check how the chart does it (in the deployment.yml template). – marcosbc Dec 22 '20 at 15:32
  • Have you solved this? I'm trying to do the same thing... – gyomihaly Sep 27 '21 at 17:14

0 Answers0