forked from EnterpriseDB/repmgr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repmgr.conf.sample
137 lines (103 loc) · 4.14 KB
/
repmgr.conf.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
###################################################
# Replication Manager sample configuration file
###################################################
# 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 master)
node=2
node_name=node2
# Database connection information
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 master node, this parameter is not required.
#
# upstream_node=1
# physical replication slots - PostgreSQL 9.4 and later only
# (default: 0)
#
# use_replication_slots=0
# 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.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
# 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.
# How many seconds we wait for master response before declaring master failure
master_response_timeout=60
# How many time we try to reconnect to master before starting failover procedure
reconnect_attempts=6
reconnect_interval=10
# Autofailover options
failover=automatic # one of 'automatic', 'manual'
priority=100 # a value of zero or less prevents the node being promoted to master
promote_command='repmgr standby promote -f /path/to/repmgr.conf'
follow_command='repmgr standby follow -f /path/to/repmgr.conf -W'
# monitoring interval; default is 2s
#
# monitor_interval_secs=2
# change wait time for master; before we bail out and exit when the master
# 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