Skip to content

Enable AXDB components

Some components require additional configuration before using them with AXDB. This sections provides configuration instructions per component.

Patroni

Patroni is the high availability solution for PostgreSQL. The High Availability in PostgreSQL with Patroni chapter provides details about the solution overview and architecture deployment.

While setting up a high availability PostgreSQL cluster with Patroni, you will need the following components:

  • Patroni installed on every postresql node.

  • Distributed Configuration Store (DCS). Patroni supports such DCSs as etcd, zookeeper, Kubernetes though etcd is the most popular one. It is available within AXDB for all supported operating systems.

  • HAProxy .

You must first enable etcd.

See the configuration guidelines for Patroni and etcd.

etcd

For etcd configuration see etcd setup.

pgBadger

Enable the following options in postgresql.conf configuration file before starting the service:

logging_collector = on
log_min_duration_statement = 0
log_line_prefix = '%t [%p]: '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
log_autovacuum_min_duration = 0
log_error_verbosity = default

For details about each option, see pdBadger documentation .

pgaudit

Add the pgaudit to shared_preload_libraries in postgresql.conf. The recommended way is to use the ALTER SYSTEM command. Connect to psql and use the following command:

ALTER SYSTEM SET shared_preload_libraries = 'pgaudit';

Start / restart the server to apply the configuration.

To configure pgaudit, you must have the privileges of a superuser. You can specify the settings in one of these ways:

  • globally (in postgresql.conf or using ALTER SYSTEM … SET),
  • at the database level (using ALTER DATABASE … SET),
  • at the role level (using ALTER ROLE … SET). Note that settings are not inherited through normal role inheritance and SET ROLE will not alter a user’s pgAudit settings. This is a limitation of the roles system and not inherent to pgAudit.

Refer to the pgaudit documentation for details about available settings.

To enable pgaudit, connect to psql and run the CREATE EXTENSION command:

CREATE EXTENSION pgaudit;

set_user

Add the set_user to shared_preload_libraries in postgresql.conf. The recommended way is to use the ALTER SYSTEM command. Connect to psql and use the following command:

ALTER SYSTEM SET shared_preload_libraries = 'set_user';

Start / restart the server to apply the configuration.

Install the extension into your database:

psql <database>
CREATE EXTENSION set_user;

You can fine-tune user behavior with the custom parameters supplied with the extension.

pgbouncer

pgbouncer requires the pgbouncer.ini configuration file to start. The path is <axdb-dir>/axdb-pgbouncer/etc/pgbouncer.ini.

Find detailed information about configuration file options in the pgbouncer documentation.

pgpool2

pgpool-II requires the configuration file to start.

You can use the sample configuration file <axdb-dir>/axdb-pgpool-II/etc/pgpool2/pgpool.conf.sample:

$ cp <axdb-dir>/axdb-pgpool-II/etc/pgpool2/pgpool.conf.sample <config-file-path>/pgpool.conf

Specify the path to it when starting pgpool:

$ pgpool -f <config-gile-path>/pgpool.conf

pg_stat_monitor

Please refer to pg_stat_monitor for setup steps.

wal2json

Enable the following option in postgresql.conf configuration file before creating a logical replication slot using the wal2json output plugin:

wal_level = logical
Start or restart the server to apply the changes.

pgvector

To get started, enable the extension for the database where you want to use it:

CREATE EXTENSION vector;

Next steps

Connect to PostgreSQL