pgmoneta

home  
releases  
getting started  
tutorials  

github  
discussions  
issues  
license  
pgmoneta  

Configuration Metrics News About

pgmoneta.conf

[pgmoneta]

Main configuration of pgmoneta.

Property Default Unit Required Description
host String Yes The bind address for pgmoneta
unix_socket_dir String Yes The Unix Domain Socket location
base_dir String Yes The base directory for pgmoneta
metrics 0 Int No The metrics port (disable = 0)
metrics_cache_max_age 0 String No The number of seconds to keep in cache a Prometheus (metrics) response. If set to zero, the caching will be disabled. Can be a string with a suffix, like 2m to indicate 2 minutes
metrics_cache_max_size 256k String No The maximum amount of data to keep in cache when serving Prometheus responses. Changes require restart. This parameter determines the size of memory allocated for the cache even if metrics_cache_max_age or metrics are disabled. Its value, however, is taken into account only if metrics_cache_max_age is set to a non-zero value. Supports suffixes: B (bytes), the default if omitted, K or KB (kilobytes), M or MB (megabytes), G or GB (gigabytes)
management 0 Int No The remote management port (disable = 0)
compression zstd String No The compression type (none, gzip, client-gzip, server-gzip, zstd, client-zstd, server-zstd, lz4, client-lz4, server-lz4, bzip2, client-bzip2)
compression_level 3 Int No The compression level
workers 0 Int No The number of workers that each process can use for its work. Use 0 to disable
retention 7 Int No The retention time in days
encryption none String No The encryption mode for encrypt wal and data none (No encryption), aes, aes-256, aes-256-cbc (AES Cipher Block Chaining mode with 256 bit key length), aes-192, aes-192-cbc (AES CBC mode with 192 bit key length), aes-128, aes-128-cbc (AES CBC mode with 128 bit key length), aes-256-ctr (AES Counter mode with 256 bit key length), aes-192-ctr (AES CTR mode with 192 bit key length), aes-128-ctr (AES CTR mode with 128 bit key length)
storage_engine local String No The storage engine type (local, ssh, s3, azure)
create_slot No Bool No Create a replication slot for all server. Valid values are: yes, no
ssh_hostname String Yes (if ssh) Defines the hostname of the remote system for connection
ssh_username String Yes (if ssh) Defines the username of the remote system for connection
ssh_base_dir String Yes (if ssh) The base directory for the remote backup
link on Bool No Use links to limit backup size
log_type console String No The logging type (console, file, syslog)
log_level info String No The logging level, any of the (case insensitive) strings FATAL, ERROR, WARN, INFO and DEBUG (that can be more specific as DEBUG1 thru DEBUG5). Debug level greater than 5 will be set to DEBUG5. Not recognized values will make the log_level be INFO
log_path pgexporter.log String No The log file location. Can be a strftime(3) compatible string
log_rotation_age 0 String No The age that will trigger a log file rotation. If expressed as a positive number, is managed as seconds. Supports suffixes: S (seconds, the default), M (minutes), H (hours), D (days), W (weeks). A value of 0 disables
log_rotation_size 0 String No The size of the log file that will trigger a log rotation. Supports suffixes: B (bytes), the default if omitted, K or KB (kilobytes), M or MB (megabytes), G or GB (gigabytes). A value of 0 (with or without suffix) disables
log_line_prefix %Y-%m-%d %H:%M:%S String No A strftime(3) compatible string to use as prefix for every log line. Must be quoted if contains spaces
log_mode append String No Append to or create the log file (append, create)
blocking_timeout 30 Int No The number of seconds the process will be blocking for a connection (disable = 0)
tls off Bool No Enable Transport Layer Security (TLS)
tls_cert_file String No Certificate file for TLS. This file must be owned by either the user running pgmoneta or root
tls_key_file String No Private key file for TLS. This file must be owned by either the user running pgmoneta or root. Additionally permissions must be at least 0640 when owned by root or 0600 otherwise.
tls_ca_file String No Certificate Authority (CA) file for TLS. This file must be owned by either the user running pgmoneta or root
libev auto String No Select the libev backend to use. Valid options: auto, select, poll, epoll, iouring, devpoll and port
buffer_size 65535 Int No The network buffer size (SO_RCVBUF and SO_SNDBUF)
backup_max_rate 0 Int No The number of bytes of tokens added every one second to limit the backup rate
network_max_rate 0 Int No The number of bytes of tokens added every one second to limit the network
keep_alive on Bool No Have SO_KEEPALIVE on sockets
nodelay on Bool No Have TCP_NODELAY on sockets
non_blocking on Bool No Have O_NONBLOCK on sockets
backlog 16 Int No The backlog for listen(). Minimum 16
hugepage try String No Huge page support (off, try, on)
pidfile String No Path to the PID file

Server section

Specifies the PostgreSQL instances.

Property Default Unit Required Description
host String Yes The address of the PostgreSQL instance
port Int Yes The port of the PostgreSQL instance
user String Yes The replication user name
backup_slot String No The replication slot for the backup
wal_slot String No The replication slot for WAL
follow String No Failover to this server if follow server fails
create_slot No Bool No Create a replication slot for all server. Valid values are: yes, no
create_slot_name String No The name of the slot. Required if create_slot is yes or physical
ssh_ciphers aes-256-ctr, aes-192-ctr, aes-128-ctr String No The supported ciphers for communication.
aes | aes-256 | aes-256-cbc: AES CBC (Cipher Block Chaining) mode with 256 bit key length
aes-192 | aes-192-cbc: AES CBC mode with 192 bit key length
aes-128 | aes-128-cbc: AES CBC mode with 128 bit key length
aes-256-ctr: AES CTR (Counter) mode with 256 bit key length
aes-192-ctr: AES CTR mode with 192 bit key length
aes-128-ctr: AES CTR mode with 128 bit key length. Otherwise verbatim
s3_aws_region String No The AWS region
s3_access_key_id String No The IAM access key ID
s3_secret_access_key String No The IAM secret access key
s3_bucket String No The AWS S3 bucket name
s3_base_dir String No The base directory for the S3 bucket
azure_storage_account String No The Azure storage account name
azure_container String No The Azure container name
azure_shared_key String No The Azure storage account key
azure_base_dir String No The base directory for the Azure container
retention 7, - , - , - Array No The retention time in days, weeks, months, years
wal_shipping String No The WAL shipping directory
hot_standby String No Hot standby directory
hot_standb_overrides String No Files to override in the hot standby directory
workers 0 Int No The number of workers that each process can use for its work. Use 0 to disable, -1 means use the global settting
backup_max_rate -1 Int No The number of bytes of tokens added every one second to limit the backup rate. Use 0 to disable, -1 means use the global settting
network_max_rate -1 Int No The number of bytes of tokens added every one second to limit the network rate. Use 0 to disable, -1 means use the global settting
tls_cert_file String No Certificate file for TLS. This file must be owned by either the user running pgmoneta or root
tls_key_file String No Private key file for TLS. This file must be owned by either the user running pgmoneta or root. Additionally permissions must be at least 0640 when owned by root or 0600 otherwise.
tls_ca_file String No Certificate Authority (CA) file for TLS. This file must be owned by either the user running pgmoneta or root

The configuration is loaded from either the path specified by the -c flag or /etc/pgmoneta/pgmoneta.conf.

Example

[pgmoneta]
host = *
metrics = 5001

base_dir = /home/pgmoneta

compression = zstd

retention = 7

log_type = file
log_level = info
log_path = /tmp/pgmoneta.log

unix_socket_dir = /tmp/

[primary]
host = localhost
port = 5432
user = repl
    

pgmoneta_users.conf

The pgmoneta_users configuration defines the users known to the system. This file is created and managed through the pgmoneta-admin tool.

The configuration is loaded from either the path specified by the -u flag or /etc/pgmoneta/pgmoneta_users.conf.

pgmoneta_admins.conf

The pgmoneta_admins configuration defines the administrators known to the system. This file is created and managed through the pgmoneta-admin tool.

The configuration is loaded from either the path specified by the -A flag or /etc/pgmoneta/pgmoneta_admins.conf.

If pgmoneta has both Transport Layer Security (TLS) and "management" enabled then pgmoneta-cli can connect with TLS using the files ~/.pgmoneta/pgmoneta.key (must be 0600 permission), ~/.pgmoneta/pgmoneta.crt and ~/.pgmoneta/root.crt.