2

How can we reload pool_hba.conf after a config change, is there a way without restarting?

Rahul
  • 895
  • 1
  • 13
  • 26

1 Answers1

4

According the documentation, it is possible to reload pgpool conf files without restarting it

pgpool [-c][-f config_file][-a hba_file][-F pcp_config_file] reload

-a, --hba-file=HBA_CONFIG_FILE Set the path to the pool_hba.conf configuration file (default: /etc/pgpool2/pool_hba.conf)

-F, --pcp-file=PCP_CONFIG_FILE Set the path to the pcp.conf configuration file (default: /etc/pgpool2/pcp.conf)

-f, --config-file=CONFIG_FILE Set the path to the pgpool.conf configuration file (default: /etc/pgpool2/pgpool.conf)

So we can build the following command

pgpool -a /etc/pgpool2/pool_hba.conf reload

Also, to reload PostgreSQL configuration files you can run pg_reload_conf():

SELECT pg_reload_conf();

 pg_reload_conf 
----------------
 t

From the documentation: pg_reload_conf () → boolean

Causes all processes of the PostgreSQL server to reload their configuration files. (This is initiated by sending a SIGHUP signal to the postmaster process, which in turn sends SIGHUP to each of its children.)

Jim Jones
  • 18,404
  • 3
  • 35
  • 44
  • can you help me create the exact command, the location of my pool_hab.conf is /etc/pgpool-II/pool_hba.conf – Rahul Mar 16 '21 at 09:29
  • @Rahul perhaps something like : `pgpool -a /etc/pgpool-II/pool_hba.conf -F /etc/pgpool-II/pcp.conf reload` or even `pgpool -a /etc/pgpool-II/pool_hba.conf reload` – Jim Jones Mar 16 '21 at 10:01
  • do i really need to reload all three or just one will do ?? Coz i have changed pool_hba.conf – Rahul Mar 16 '21 at 10:05
  • @Rahul what about `pgpool -a /etc/pgpool-II/pool_hba.conf reload`? – Jim Jones Mar 16 '21 at 10:15