Advertisement
Guest User

repmgr.conf pgclu-sql-01

a guest
Mar 28th, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.96 KB | None | 0 0
  1. ###################################################
  2. # repmgr sample configuration file
  3. ###################################################
  4.  
  5. # Some configuration items will be set with a default value; this
  6. # is noted for each item. Where no default value is shown, the
  7. # parameter will be treated as empty or false.
  8.  
  9. # =============================================================================
  10. # Required configuration items
  11. # =============================================================================
  12. #
  13. # repmgr and repmgrd require the following items to be explicitly configured.
  14.  
  15.  
  16. node_id=1 # A unique integer greater than zero
  17. node_name='pgsql-clu-01' # An arbitrary (but unique) string; we recommend
  18. # using the server's hostname or another identifier
  19. # unambiguously associated with the server to avoid
  20. # confusion. Avoid choosing names which reflect the
  21. # node's current role, e.g. "primary" or "standby1",
  22. # as roles can change and it will be confusing if
  23. # the current primary is called "standby1".
  24.  
  25. conninfo='host=pgsql-clu-01 dbname=repmgr' # Database connection information as a conninfo string.
  26. # All servers in the cluster must be able to connect to
  27. # the local node using this string.
  28. #
  29. # For details on conninfo strings, see:
  30. # https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
  31. #
  32. # If repmgrd is in use, consider explicitly setting
  33. # "connect_timeout" in the conninfo string to determine
  34. # the length of time which elapses before a network
  35. # connection attempt is abandoned; for details see:
  36. # https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT
  37.  
  38. data_directory='/var/lib/pgsql/9.6/data' # The node's data directory. This is needed by repmgr
  39. # when performing operations when the PostgreSQL instance
  40. # is not running and there's no other way of determining
  41. # the data directory.
  42.  
  43.  
  44. # =============================================================================
  45.  
  46. # Optional configuration items
  47. # =============================================================================
  48.  
  49.  
  50. #------------------------------------------------------------------------------
  51. # Server settings
  52. #------------------------------------------------------------------------------
  53.  
  54. #config_directory='' # If configuration files are located outside the data
  55. # directory, specify the directory where the main
  56. # postgresql.conf file is located.
  57.  
  58. #------------------------------------------------------------------------------
  59. # Replication settings
  60. #------------------------------------------------------------------------------
  61.  
  62. replication_user='postgres' # User to make replication connections with, if not set defaults
  63. # to the user defined in "conninfo".
  64.  
  65. replication_type=physical # Must be one of 'physical' or 'bdr'.
  66.  
  67. #location=default # arbitrary string defining the location of the node; this
  68. # is used during failover to check visibilty of the
  69. # current primary node. See the 'repmgrd' documentation
  70. # in README.md for further details.
  71.  
  72. use_replication_slots=yes # whether to use physical replication slots
  73. # NOTE: when using replication slots,
  74. # 'max_replication_slots' should be configured for
  75. # at least the number of standbys which will connect
  76. # to the primary.
  77.  
  78. #------------------------------------------------------------------------------
  79. # Witness server settings
  80. #------------------------------------------------------------------------------
  81.  
  82. #witness_sync_interval=15 # interval (in seconds) to synchronise node records
  83. # to the witness server
  84.  
  85. #------------------------------------------------------------------------------
  86. # Logging settings
  87. #------------------------------------------------------------------------------
  88. #
  89. # Note that logging facility settings will only apply to `repmgrd` by default;
  90. # `repmgr` will always write to STDERR unless the switch `--log-to-file` is
  91. # supplied, in which case it will log to the same destination as `repmgrd`.
  92. # This is mainly intended for those cases when `repmgr` is executed directly
  93. # by `repmgrd`.
  94.  
  95. #log_level=INFO # Log level: possible values are DEBUG, INFO, NOTICE,
  96. # WARNING, ERROR, ALERT, CRIT or EMERG
  97.  
  98. #log_facility=STDERR # Logging facility: possible values are STDERR, or for
  99. # syslog integration, one of LOCAL0, LOCAL1, ..., LOCAL7, USER
  100.  
  101. #log_file='' # STDERR can be redirected to an arbitrary file
  102. #log_status_interval=300 # interval (in seconds) for repmgrd to log a status message
  103.  
  104.  
  105. #------------------------------------------------------------------------------
  106. # Event notification settings
  107. #------------------------------------------------------------------------------
  108.  
  109. # event notifications can be passed to an arbitrary external program
  110. # together with the following parameters:
  111. #
  112. # %n - node ID
  113. # %e - event type
  114. # %s - success (1 or 0)
  115. # %t - timestamp
  116. # %d - details
  117. #
  118. # the values provided for "%t" and "%d" will probably contain spaces,
  119. # so should be quoted in the provided command configuration, e.g.:
  120. #
  121. # event_notification_command='/path/to/some/script %n %e %s "%t" "%d"'
  122. #
  123. # By default, all notifications will be passed; the notification types
  124. # can be filtered to explicitly named ones, e.g.:
  125. #
  126. # event_notifications=primary_register,standby_register
  127.  
  128. #event_notification_command='' # An external program or script which
  129. # can be executed by the user under which
  130. # repmgr/repmgrd are run.
  131.  
  132. #event_notifications='' # A commas-separated list of notification
  133. # types
  134.  
  135. #------------------------------------------------------------------------------
  136. # Environment/command settings
  137. #------------------------------------------------------------------------------
  138.  
  139. pg_bindir='/usr/pgsql-9.6/bin/' # Path to PostgreSQL binary directory (location
  140. # of pg_ctl, pg_basebackup etc.). Only needed
  141. # if these files are not in the system $PATH.
  142. #
  143. # Debian/Ubuntu users: you will probably need to
  144. # set this to the directory where `pg_ctl` is located,
  145. # e.g. /usr/lib/postgresql/9.6/bin/
  146. #
  147. # *NOTE* "pg_bindir" is only used when repmgr directly
  148. # executes PostgreSQL binaries; any user-defined scripts
  149. # *must* be specified with the full path
  150.  
  151. #repmgr_bindir='' # Path to repmgr binary directory (location of the repmgr
  152. # binary. Only needed if the repmgr executable is not in
  153. # the system $PATH or the path defined in "pg_bindir".
  154.  
  155. #use_primary_conninfo_password=false # explicitly set "password" in recovery.conf's
  156. # "primary_conninfo" parameter using the value contained
  157. # in the environment variable PGPASSWORD
  158. #passfile='' # path to .pgpass file to include in "primary_conninfo"
  159. #------------------------------------------------------------------------------
  160. # external command options
  161. #------------------------------------------------------------------------------
  162. #
  163. # Options which can be passed to external commands invoked by repmgr/repmgrd.
  164. #
  165. # Examples:
  166. #
  167. # pg_ctl_options='-s'
  168. # pg_basebackup_options='--label=repmgr_backup'
  169. # rsync_options=--archive --checksum --compress --progress --rsh="ssh -o \"StrictHostKeyChecking no\""
  170. # ssh_options=-o "StrictHostKeyChecking no"
  171.  
  172. #pg_ctl_options='' # Options to append to "pg_ctl"
  173. #pg_basebackup_options='' # Options to append to "pg_basebackup"
  174. #rsync_options='' # Options to append to "rsync"
  175. ssh_options='-q -o ConnectTimeout=10' # Options to append to "ssh"
  176.  
  177.  
  178.  
  179. #------------------------------------------------------------------------------
  180. # "standby clone" settings
  181. #------------------------------------------------------------------------------
  182. #
  183. # These settings apply when cloning a standby ("repmgr standby clone").
  184. #
  185. # Examples:
  186. #
  187. # tablespace_mapping=/path/to/original/tablespace=/path/to/new/tablespace
  188. # restore_command = 'cp /path/to/archived/wals/%f %p'
  189.  
  190. #tablespace_mapping='' # Tablespaces can be remapped from one
  191. # file system location to another. This
  192. # parameter can be provided multiple times.
  193.  
  194. #restore_command='' # This will be placed in the recovery.conf file generated
  195. # by repmgr.
  196.  
  197. #archive_cleanup_command='' # This will be placed in the recovery.conf file generated
  198. # by repmgr. Note we recommend using Barman for managing
  199. # WAL archives (see: https://www.pgbarman.org )
  200.  
  201. #recovery_min_apply_delay= # If provided, "recovery_min_apply_delay" in recovery.conf
  202. # will be set to this value (PostgreSQL 9.4 and later).
  203.  
  204.  
  205. #------------------------------------------------------------------------------
  206. # "standby promote" settings
  207. #------------------------------------------------------------------------------
  208.  
  209. # These settings apply when instructing a standby to promote itself to the
  210. # new primary ("repmgr standby promote").
  211.  
  212. #promote_check_timeout=60 # The length of time (in seconds) to wait
  213. # for the new primary to finish promoting
  214. #promote_check_interval=1 # The interval (in seconds) to check whether
  215. # the new primary has finished promoting
  216.  
  217.  
  218. #------------------------------------------------------------------------------
  219. # "standby follow" settings
  220. #------------------------------------------------------------------------------
  221.  
  222. # These settings apply when instructing a standby to follow the new primary
  223. # ("repmgr standby follow").
  224.  
  225. #primary_follow_timeout=60 # The max length of time (in seconds) to wait
  226. # for the new primary to become available
  227. #standby_follow_timeout=15 # The max length of time (in seconds) to wait
  228. # for the standby to connect to the primary
  229.  
  230.  
  231. #------------------------------------------------------------------------------
  232. # "standby switchover" settings
  233. #------------------------------------------------------------------------------
  234.  
  235. # These settings apply when switching roles between a primary and a standby
  236. # ("repmgr standby switchover").
  237.  
  238. #shutdown_check_timeout=60 # The max length of time (in seconds) to wait for the demotion
  239. # candidate (current primary) to shut down
  240. #standby_reconnect_timeout=60 # The max length of time (in seconds) to wait
  241. # for the demoted standby to reconnect to the promoted
  242. # primary (note: this value should be equal to or greater
  243. # than that set for "node_rejoin_timeout")
  244.  
  245. #------------------------------------------------------------------------------
  246. # "node rejoin" settings
  247. #------------------------------------------------------------------------------
  248.  
  249. # These settings apply when reintegrating a node into a replication cluster
  250. # with "repmgrd_node_rejoin"
  251.  
  252. #node_rejoin_timeout=60 # The maximum length of time (in seconds) to wait for
  253. # the node to reconnect to the replication cluster
  254.  
  255. #------------------------------------------------------------------------------
  256. # Barman options
  257. #------------------------------------------------------------------------------
  258.  
  259. #barman_server='' # The barman configuration section
  260. #barman_host='' # The host name of the barman server
  261. #barman_config='' # The Barman configuration file on the
  262. # Barman server (needed if the file is
  263. # in a non-standard location)
  264.  
  265. #------------------------------------------------------------------------------
  266. # Failover and monitoring settings (repmgrd)
  267. #------------------------------------------------------------------------------
  268. #
  269. # These settings are only applied when repmgrd is running. Values shown
  270. # are defaults.
  271.  
  272. #repmgrd_pid_file= # Path of PID file to use for repmgrd; if not set, a PID file will
  273. # be generated in a temporary directory specified by the environment
  274. # variable $TMPDIR, or if not set, in "/tmp". This value can be overridden
  275. # by the command line option "-p/--pid-file"; the command line option
  276. # "--no-pid-file" will force PID file creation to be skipped.
  277. #failover=manual # one of 'automatic', 'manual'.
  278. # determines what action to take in the event of upstream failure
  279. #
  280. # 'automatic': repmgrd will automatically attempt to promote the
  281. # node or follow the new upstream node
  282. # 'manual': repmgrd will take no action and the node will require
  283. # manual attention to reattach it to replication
  284. # (does not apply to BDR mode)
  285.  
  286. #priority=100 # indicate a preferred priority for promoting nodes;
  287. # a value of zero prevents the node being promoted to primary
  288. # (default: 100)
  289.  
  290. #reconnect_attempts=6 # Number of attempts which will be made to reconnect to an unreachable
  291. # primary (or other upstream node)
  292. #reconnect_interval=10 # Interval between attempts to reconnect to an unreachable
  293. # primary (or other upstream node)
  294. #promote_command= # command repmgrd executes when promoting a new primary; use something like:
  295. #
  296. # repmgr standby promote -f /etc/repmgr.conf
  297. #
  298. #follow_command= # command repmgrd executes when instructing a standby to follow a new primary;
  299. # use something like:
  300. #
  301. # repmgr standby follow -f /etc/repmgr.conf -W --upstream-node-id=%n
  302. #
  303. #primary_notification_timeout=60 # Interval (in seconds) which repmgrd on a standby
  304. # will wait for a notification from the new primary,
  305. # before falling back to degraded monitoring
  306. #repmgrd_standby_startup_timeout=60 # Interval (in seconds) which repmgrd on a standby will wait
  307. # for the the local node to restart and become ready to accept connections after
  308. # executing "follow_command" (defaults to the value set in "standby_reconnect_timeout")
  309.  
  310. #monitoring_history=no # Whether to write monitoring data to the "montoring_history" table
  311. #monitor_interval_secs=2 # Interval (in seconds) at which to write monitoring data
  312. #degraded_monitoring_timeout=-1 # Interval (in seconds) after which repmgrd will terminate if the
  313. # server being monitored is no longer available. -1 (default)
  314. # disables the timeout completely.
  315. #async_query_timeout=60 # Interval (in seconds) which repmgrd will wait before
  316. # cancelling an asynchronous query.
  317.  
  318. #------------------------------------------------------------------------------
  319. # service control commands
  320. #------------------------------------------------------------------------------
  321. #
  322. # repmgr provides options to override the default pg_ctl commands
  323. # used to stop, start, restart, reload and promote the PostgreSQL cluster
  324. #
  325. # NOTE: These commands must be runnable on remote nodes as well for switchover
  326. # to function correctly.
  327. #
  328. # If you use sudo, the user repmgr runs as (usually 'postgres') must have
  329. # passwordless sudo access to execute the command.
  330. #
  331. # For example, to use systemd, you can set
  332. #
  333. # service_start_command = 'sudo systemctl start postgresql-9.6'
  334. # (...)
  335. #
  336. # and then use the following sudoers configuration:
  337. #
  338. # # this is required when running sudo over ssh without -t:
  339. # Defaults:postgres !requiretty
  340. # postgres ALL = NOPASSWD: /usr/bin/systemctl stop postgresql-9.6, \
  341. # /usr/bin/systemctl start postgresql-9.6, \
  342. # /usr/bin/systemctl restart postgresql-9.6
  343. #
  344. # Debian/Ubuntu users: use "sudo pg_ctlcluster" to execute service control commands.
  345. #
  346. # For more details, see: https://repmgr.org/docs/4.1/configuration-service-commands.html
  347.  
  348. #service_start_command = ''
  349. #service_stop_command = ''
  350. #service_restart_command = ''
  351. #service_reload_command = ''
  352. #service_promote_command = '' # This parameter is intended for systems which provide a
  353. # package-level promote command, such as Debian's
  354. # "pg_ctlcluster". *IMPORTANT*: it is *not* a substitute
  355. # for "promote_command"; do not use "repmgr standby promote"
  356. # (or a script which executes "repmgr standby promote") here.
  357.  
  358. #------------------------------------------------------------------------------
  359. # Status check thresholds
  360. #------------------------------------------------------------------------------
  361.  
  362. # Various warning/critical thresholds used by "repmgr node check".
  363.  
  364. #archive_ready_warning=16 # repmgr node check --archive-ready
  365. #archive_ready_critical=128 #
  366. # Numbers of files pending archiving via PostgreSQL's
  367. # "archive_command" configuration parameter. If
  368. # files can't be archived fast enough, or the archive
  369. # command is failing, the buildup of files can
  370. # cause various issues, such as server shutdown being
  371. # delayed until all files are archived, or excessive
  372. # space being occupied by unarchived files.
  373. #
  374. # Note that these values will be checked when executing
  375. # "repmgr standby switchover" to warn about potential
  376. # issues with shutting down the demotion candidate.
  377.  
  378. #replication_lag_warning=300 # repmgr node check --replication-lag
  379. #replication_lag_critical=600 #
  380. # Note that these values will be checked when executing
  381. # "repmgr standby switchover" to warn about potential
  382. # issues with shutting down the demotion candidate.
  383.  
  384.  
  385. #------------------------------------------------------------------------------
  386. # BDR monitoring options
  387. #------------------------------------------------------------------------------
  388.  
  389. #bdr_local_monitoring_only=false # Only monitor the local node; no checks will be
  390. # performed on the other node
  391. #bdr_recovery_timeout # If a BDR node was offline and has become available
  392. # maximum length of time in seconds to wait for the
  393. # node to reconnect to the cluster
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement