Configuring haproxy v23
TPA installs and configures haproxy on instances whose
By default, haproxy listens on
127.0.0.1:5432 for requests forwarded
pgbouncer running on the same instance. You must
specify a list of
haproxy_backend_servers to forward requests to.
TPA installs the latest available version of haproxy by default.
haproxy_package_version: 1.9.15* or any valid version specifier
to install a different version.
See limitations of using wildcards in
Haproxy packages are selected according to the type of architecture. You can use an EDB-managed haproxy package, but it requires a subscription. Packages from PGDG extras repo can be installed if required.
You can set the following variables on any
|The address for haproxy to bind to.
|5432 (5444 for EPAS)
|The TCP port for haproxy to listen on.
|5433 (5445 for EPAS)
|TCP port for read-only load balancer.
|A list of Postgres instance names.
|The maximum number of connections allowed per backend server. The default is derived from the backend's
|Add known haproxy hosts as
failover_manager is harp or patroni.
Haproxy can be configured to listen on an additional port for read-only access to the database. Currently, this is supported only with the Patroni failover manager. The backend health check determines which Postgres instances are currently acting as replicas and uses round-robin load balancing to distribute traffic to them.
The read-only load balancer is disabled by default. You can turn it on
/etc/haproxy/haproxy.cfg with a backend that has
default-server line and one line per backend server. All but the
first one are marked as "backup" servers.
To add options to the
default-server line, set
haproxy_default_server_extra_options to a list of options on the
To add options (which override the defaults) to the individual server
lines for each backend, set
haproxy_server_options to a list of options on the backend server.