Name

ocf:pgsql — Manages a PostgreSQL database instance

Synopsis

[OCF_RESKEY_pgctl=string] [OCF_RESKEY_start_opt=string] [OCF_RESKEY_ctl_opt=string] [OCF_RESKEY_psql=string] [OCF_RESKEY_pgdata=string] [OCF_RESKEY_pgdba=string] [OCF_RESKEY_pghost=string] [OCF_RESKEY_pgport=integer] [OCF_RESKEY_monitor_user=string] [OCF_RESKEY_monitor_password=string] [OCF_RESKEY_monitor_sql=string] [OCF_RESKEY_config=string] [OCF_RESKEY_pgdb=string] [OCF_RESKEY_logfile=string] [OCF_RESKEY_socketdir=string] [OCF_RESKEY_stop_escalate=integer] [OCF_RESKEY_rep_mode=string] [OCF_RESKEY_node_list=string] [OCF_RESKEY_restore_command=string] [OCF_RESKEY_archive_cleanup_command=string] [OCF_RESKEY_recovery_end_command=string] [OCF_RESKEY_master_ip=string] [OCF_RESKEY_repuser=string] [OCF_RESKEY_primary_conninfo_opt=string] [OCF_RESKEY_restart_on_promote=boolean] [OCF_RESKEY_tmpdir=string] [OCF_RESKEY_xlog_check_count=integer] [OCF_RESKEY_crm_attr_timeout=integer] [OCF_RESKEY_stop_escalate_in_slave=integer] [OCF_RESKEY_check_wal_receiver=boolean] pgsql [start | stop | status | monitor | monitor | promote | demote | notify | meta-data | validate-all | methods]

Description

Resource script for PostgreSQL. It manages a PostgreSQL as an HA resource.

Supported Parameters

OCF_RESKEY_pgctl=pgctl

Path to pg_ctl command.

OCF_RESKEY_start_opt=start_opt

Start options (-o start_opt in pg_ctl). "-i -p 5432" for example.

OCF_RESKEY_ctl_opt=ctl_opt

Additional pg_ctl options (-w, -W etc..).

OCF_RESKEY_psql=psql

Path to psql command.

OCF_RESKEY_pgdata=pgdata

Path to PostgreSQL data directory.

OCF_RESKEY_pgdba=pgdba

User that owns PostgreSQL.

OCF_RESKEY_pghost=pghost

Hostname/IP address where PostgreSQL is listening

OCF_RESKEY_pgport=pgport

Port where PostgreSQL is listening

OCF_RESKEY_monitor_user=monitor_user

PostgreSQL user that pgsql RA will user for monitor operations. If it's not set pgdba user will be used.

OCF_RESKEY_monitor_password=monitor_password

Password for monitor user.

OCF_RESKEY_monitor_sql=monitor_sql

SQL script that will be used for monitor operations.

OCF_RESKEY_config=Configuration file

Path to the PostgreSQL configuration file for the instance.

OCF_RESKEY_pgdb=pgdb

Database that will be used for monitoring.

OCF_RESKEY_logfile=logfile

Path to PostgreSQL server log output file.

OCF_RESKEY_socketdir=socketdir

Unix socket directory for PostgeSQL

OCF_RESKEY_stop_escalate=stop escalation

Number of shutdown retries (using -m fast) before resorting to -m immediate

OCF_RESKEY_rep_mode=rep_mode

Replication mode may be set to "async" or "sync" or "slave". They require PostgreSQL 9.1 or later. Once set, "async" and "sync" require node_list, master_ip, and restore_command parameters,as well as configuring postgresql for replication (in postgresql.conf and pg_hba.conf). "slave" means that RA only makes recovery.conf before starting to connect to Primary which is running somewhere. It dosen't need Master/Slave setting. It requires master_ip restore_command parameters.

OCF_RESKEY_node_list=node list

All node names. Please separate each node name with a space. This is required for replication.

OCF_RESKEY_restore_command=restore_command

restore_command for recovery.conf. This is required for replication.

OCF_RESKEY_archive_cleanup_command=archive_cleanup_command

archive_cleanup_command for recovery.conf. This is used for replication and is optional.

OCF_RESKEY_recovery_end_command=recovery_end_command

recovery_end_command for recovery.conf. This is used for replication and is optional.

OCF_RESKEY_master_ip=master ip

Master's floating IP address to be connected from hot standby. This parameter is used for "primary_conninfo" in recovery.conf. This is required for replication.

OCF_RESKEY_repuser=repuser

User used to connect to the master server. This parameter is used for "primary_conninfo" in recovery.conf. This is required for replication.

OCF_RESKEY_primary_conninfo_opt=primary_conninfo_opt

primary_conninfo options of recovery.conf except host, port, user and application_name. This is optional for replication.

OCF_RESKEY_restart_on_promote=restart_on_promote

If this is true, RA deletes recovery.conf and restarts PostgreSQL on promote to keep Timeline ID. It probably makes fail-over slower. It's recommended to set on-fail of promote up as fence. This is optional for replication.

OCF_RESKEY_tmpdir=tmpdir

Path to temporary directory. This is optional for replication.

OCF_RESKEY_xlog_check_count=xlog check count

Number of checking xlog on monitor before promote. This is optional for replication.

OCF_RESKEY_crm_attr_timeout=The timeout of crm_attribute forever update command.

The timeout of crm_attribute forever update command. Default value is 5 seconds. This is optional for replication.

OCF_RESKEY_stop_escalate_in_slave=stop escalation_in_slave

Number of shutdown retries (using -m fast) before resorting to -m immediate in Slave state. This is optional for replication.

OCF_RESKEY_check_wal_receiver=check_wal_receiver

If this is true, RA checks wal_receiver process on monitor and notify its status using "(resource name)-receiver-status" attribute. It's useful for checking whether PostgreSQL(Hot Standby) connects to primary. The attribute shows status as "normal" or "ERROR".


SUSE Linux Enterprise High Availability Extension High Availability Guide 11 SP3