如何在不重启的情况下在 pgpool 中重新加载 pool_hba.conf?

How to reload pool_hba.conf in pgpool without restart?

如何在更改配置后重新加载pool_hba.conf,有没有不重启的方法?

根据文档,可以重新加载 pgpool 配置文件 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)

所以我们可以构建以下命令

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

此外,要重新加载 PostgreSQL 配置文件,您可以 运行 pg_reload_conf():

SELECT pg_reload_conf();

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

来自文档: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.)