mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
Although the witness server will resync the repl_nodes table following a failover, other operations (e.g. removing or cloning a standby) were previously not reflected in the witness server's copy of this table. As a short-term workaround, automatically resync the table at regular intervals (defined by the configuration file parameter "witness_repl_nodes_sync_interval_secs", default 30 seconds).
152 lines
5.2 KiB
Plaintext
152 lines
5.2 KiB
Plaintext
###################################################
|
|
# Replication Manager sample configuration file
|
|
###################################################
|
|
|
|
# Some configuration items will be set with a default value; this
|
|
# is noted for each item. Where no default value is shown, the
|
|
# parameter will be treated as empty or false.
|
|
|
|
# Required configuration items
|
|
# ============================
|
|
#
|
|
# repmgr and repmgrd require these items to be configured:
|
|
|
|
# Cluster name - this will be used by repmgr to generate its internal
|
|
# schema (pattern: "repmgr_{cluster}"); while this name will be quoted
|
|
# to preserve case, we recommend using lower case and avoiding whitespace
|
|
# to facilitate easier querying of the repmgr views and tables.
|
|
cluster=example_cluster
|
|
|
|
# Node ID and name
|
|
# (Note: we recommend to avoid naming nodes after their initial
|
|
# replication funcion, as this will cause confusion when e.g.
|
|
# "standby2" is promoted to primary)
|
|
node=2 # a unique integer
|
|
node_name=node2 # an arbitrary (but unique) string; we recommend using
|
|
# the server's hostname or another identifier unambiguously
|
|
# associated with the server to avoid confusion
|
|
|
|
# Database connection information as a conninfo string
|
|
# This must be accessible to all servers in the cluster; for details see:
|
|
# http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
|
|
conninfo='host=192.168.204.104 dbname=repmgr_db user=repmgr_usr'
|
|
|
|
# Optional configuration items
|
|
# ============================
|
|
|
|
# Replication settings
|
|
# ---------------------
|
|
|
|
# when using cascading replication and a standby is to be connected to an
|
|
# upstream standby, specify that node's ID with 'upstream_node'. The node
|
|
# must exist before the new standby can be registered. If a standby is
|
|
# to connect directly to a primary node, this parameter is not required.
|
|
upstream_node=1
|
|
|
|
# use physical replication slots - PostgreSQL 9.4 and later only
|
|
# (default: 0)
|
|
use_replication_slots=0
|
|
|
|
# NOTE: 'max_replication_slots' should be configured for at least the
|
|
# number of standbys which will connect to the primary.
|
|
|
|
# Logging and monitoring settings
|
|
# -------------------------------
|
|
|
|
# Log level: possible values are DEBUG, INFO, NOTICE, WARNING, ERR, ALERT, CRIT or EMERG
|
|
# (default: NOTICE)
|
|
loglevel=NOTICE
|
|
|
|
# Logging facility: possible values are STDERR or - for Syslog integration - one of LOCAL0, LOCAL1, ..., LOCAL7, USER
|
|
# (default: STDERR)
|
|
logfacility=STDERR
|
|
|
|
# stderr can be redirected to an arbitrary file:
|
|
#
|
|
logfile='/var/log/repmgr/repmgr.log'
|
|
|
|
# event notifications can be passed to an arbitrary external program
|
|
# together with the following parameters:
|
|
#
|
|
# %n - node ID
|
|
# %e - event type
|
|
# %s - success (1 or 0)
|
|
# %t - timestamp
|
|
# %d - details
|
|
#
|
|
# the values provided for "%t" and "%d" will probably contain spaces,
|
|
# so should be quoted in the provided command configuration, e.g.:
|
|
#
|
|
event_notification_command='/path/to/some/script %n %e %s "%t" "%d"'
|
|
|
|
# By default, all notifications will be passed; the notification types
|
|
# can be filtered to explicitly named ones:
|
|
#
|
|
event_notifications=master_register,standby_register,witness_create
|
|
|
|
|
|
# Environment/command settings
|
|
# ----------------------------
|
|
|
|
# path to PostgreSQL binary directory (location of pg_ctl, pg_basebackup etc.)
|
|
# (if not provided, defaults to system $PATH)
|
|
pg_bindir=/usr/bin/
|
|
|
|
# external command options
|
|
|
|
rsync_options=--archive --checksum --compress --progress --rsh="ssh -o \"StrictHostKeyChecking no\""
|
|
ssh_options=-o "StrictHostKeyChecking no"
|
|
|
|
# external command arguments. Values shown are examples.
|
|
|
|
pg_ctl_options='-s'
|
|
pg_basebackup_options='--xlog-method=s'
|
|
|
|
|
|
# Standby clone settings
|
|
# ----------------------
|
|
#
|
|
# These settings apply when cloning a standby (`repmgr standby clone`).
|
|
|
|
# Tablespaces can be remapped from one file system location to another:
|
|
#
|
|
# tablespace_mapping=/path/to/original/tablespace=/path/to/new/tablespace
|
|
|
|
|
|
# Failover settings (repmgrd)
|
|
# ---------------------------
|
|
#
|
|
# These settings are only applied when repmgrd is running. Values shown
|
|
# are defaults.
|
|
|
|
# Number of seconds to wait for a response from the primary server before
|
|
# deciding it has failed.
|
|
|
|
master_response_timeout=60
|
|
|
|
# Number of attempts at what interval (in seconds) to try and
|
|
# connect to a server to establish its status (e.g. master
|
|
# during failover)
|
|
reconnect_attempts=6
|
|
reconnect_interval=10
|
|
|
|
# Autofailover options
|
|
failover=manual # one of 'automatic', 'manual'
|
|
# (default: manual)
|
|
priority=100 # a value of zero or less prevents the node being promoted to primary
|
|
# (default: 100)
|
|
promote_command='repmgr standby promote -f /path/to/repmgr.conf'
|
|
follow_command='repmgr standby follow -f /path/to/repmgr.conf -W'
|
|
|
|
# monitoring interval in seconds; default is 2
|
|
monitor_interval_secs=2
|
|
|
|
# change wait time for primary; before we bail out and exit when the primary
|
|
# disappears, we wait 'reconnect_attempts' * 'retry_promote_interval_secs'
|
|
# seconds; by default this would be half an hour, as 'retry_promote_interval_secs'
|
|
# default value is 300)
|
|
retry_promote_interval_secs=300
|
|
|
|
# Number of seconds after which the witness server resyncs the repl_nodes table
|
|
witness_repl_nodes_sync_interval_secs=15
|