Section 7 · Overviews and conventions

ocf_heartbeat_pgsqlms.7

Package: resource-agents-paf

OCF_HEARTBEAT_PGSQLM

NAME
SYNOPSIS
DESCRIPTION
SUPPORTED PARAMETERS
SUPPORTED ACTIONS
EXAMPLE CRM SHELL
EXAMPLE PCS
SEE ALSO
AUTHOR


NAME

ocf_heartbeat_pgsqlms − Manages PostgreSQL servers in replication

SYNOPSIS

pgsqlms [start | stop | monitor | promote | demote | meta−data | validate−all]

DESCRIPTION

Resource script for PostgreSQL in replication. It manages PostgreSQL servers using streaming replication as an HA resource.

SUPPORTED PARAMETERS

system_user

System user account used to run the PostgreSQL server

(optional, string, default “postgres”)

bindir

Path to the directory storing the PostgreSQL binaries. The agent uses psql, pg_isready, pg_controldata and pg_ctl.

(optional, string, default “/usr/bin”)

pgdata

Path to the data directory, e.g. PGDATA

(unique, optional, string, default “/var/lib/pgsql/data”)

datadir

Path to the directory set in data_directory from your postgresql.conf file. This parameter has the same default than PostgreSQL itself: the pgdata parameter value. Unless you have a special PostgreSQL setup and you understand this parameter, ignore it.

(unique, optional, string, default “PGDATA”)

pghost

Host IP address or unix socket folder the instance is listening on.

(optional, string, default “/tmp”)

pgport

Port the instance is listening on.

(optional, integer, default 5432)

maxlag

Maximum lag allowed on a standby before forbidding any promotion on it. The calculation is based on the difference between the current LSN on the primary and the LSN written on the standby. This parameter must be a valid positive number as described in PostgreSQL documentation. See: https://www.postgresql.org/docs/current/static/sql−syntax−lexical.html#SQL−SYNTAX−CONSTANTS−NUMERIC

(optional, integer, default 0)

recovery_template

Path to the recovery.conf template. This file is simply copied to $PGDATA before starting the instance as standby. ONLY for PostgreSQL 11 and bellow. This parameter is IGNORED for PostgreSQL 12 and higher. The cluster will refuse to start if a template file is found.

(unique, optional, string, default “PGDATA/recovery.conf.pcmk”)

start_opts

Additionnal arguments given to the postgres process on startup. See “postgres −−help” for available options. Usefull when the postgresql.conf file is not in the data directory (PGDATA), eg.: “−c config_file=/etc/postgresql/9.3/main/postgresql.conf”.

(optional, string, no default)

SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

start

Starts the resource. Suggested minimum timeout: 60.

stop

Stops the resource. Suggested minimum timeout: 60.

reload

Suggested minimum timeout: 20.

promote

Promotes the resource to the Master role. Suggested minimum timeout: 30.

demote

Demotes the resource to the Slave role. Suggested minimum timeout: 120.

monitor (Master role)

Performs a detailed status check. Suggested minimum timeout: 10. Suggested interval: 15.

monitor (Slave role)

Performs a detailed status check. Suggested minimum timeout: 10. Suggested interval: 16.

notify

Suggested minimum timeout: 60.

meta−data

Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5.

validate−all

Performs a validation of the resource configuration. Suggested minimum timeout: 5.

methods

Suggested minimum timeout: 5.

EXAMPLE CRM SHELL

The following is an example configuration for a pgsqlms resource using the crm(8) shell:

primitive p_pgsqlms ocf:heartbeat:pgsqlms \
op monitor depth=“0” timeout=“10” interval=“15” role=“Master” \
op monitor depth=“0” timeout=“10” interval=“16” role=“Slave”

ms ms_pgsqlms p_pgsqlms \
meta notify=“true” interleave=“true”

EXAMPLE PCS

The following is an example configuration for a pgsqlms resource using pcs(8)

pcs resource create p_pgsqlms ocf:heartbeat:pgsqlms \
op monitor OCF_CHECK_LEVEL=“0” timeout=“10” interval=“15” role=“Master” \
op monitor OCF_CHECK_LEVEL=“0” timeout=“10” interval=“16” role=“Slave” promotable

SEE ALSO

http://clusterlabs.org/

AUTHOR

ClusterLabs contributors (see the resource agent source for information about individual authors)