'\" t .\" Title: ocf_heartbeat_pgsql .\" Author: Linux-HA contributors (see the resource agent source for information about individual authors) .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 02/21/2014 .\" Manual: OCF resource agents .\" Source: resource-agents UNKNOWN .\" Language: English .\" .TH "OCF_HEARTBEAT_PGSQL" "7" "02/21/2014" "resource-agents UNKNOWN" "OCF resource agents" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ocf_heartbeat_pgsql \- Manages a PostgreSQL database instance .SH "SYNOPSIS" .HP \w'\fBpgsql\fR\ 'u \fBpgsql\fR [start | stop | status | monitor | promote | demote | meta\-data | validate\-all] .SH "DESCRIPTION" .PP Resource script for PostgreSQL\&. It manages a PostgreSQL as an HA resource\&. .SH "SUPPORTED PARAMETERS" .PP \fBpgctl\fR .RS 4 Path to pg_ctl command\&. .sp (optional, string, default "/usr/bin/pg_ctl") .RE .PP \fBstart_opt\fR .RS 4 Start options (\-o start_opt in pg_ctl)\&. "\-i \-p 5432" for example\&. .sp (optional, string, no default) .RE .PP \fBctl_opt\fR .RS 4 Additional pg_ctl options (\-w, \-W etc\&.\&.)\&. .sp (optional, string, no default) .RE .PP \fBpsql\fR .RS 4 Path to psql command\&. .sp (optional, string, default "/usr/bin/psql") .RE .PP \fBpgdata\fR .RS 4 Path to PostgreSQL data directory\&. .sp (optional, string, default "/var/lib/pgsql/data") .RE .PP \fBpgdba\fR .RS 4 User that owns PostgreSQL\&. .sp (optional, string, default "postgres") .RE .PP \fBpghost\fR .RS 4 Hostname/IP address where PostgreSQL is listening .sp (optional, string, no default) .RE .PP \fBpgport\fR .RS 4 Port where PostgreSQL is listening .sp (optional, integer, default 5432) .RE .PP \fBmonitor_user\fR .RS 4 PostgreSQL user that pgsql RA will user for monitor operations\&. If it\*(Aqs not set pgdba user will be used\&. .sp (optional, string, no default) .RE .PP \fBmonitor_password\fR .RS 4 Password for monitor user\&. .sp (optional, string, no default) .RE .PP \fBmonitor_sql\fR .RS 4 SQL script that will be used for monitor operations\&. .sp (optional, string, default "select now();") .RE .PP \fBconfig\fR .RS 4 Path to the PostgreSQL configuration file for the instance\&. .sp (optional, string, default "/var/lib/pgsql/data/postgresql\&.conf") .RE .PP \fBpgdb\fR .RS 4 Database that will be used for monitoring\&. .sp (optional, string, default "template1") .RE .PP \fBlogfile\fR .RS 4 Path to PostgreSQL server log output file\&. .sp (optional, string, default "/dev/null") .RE .PP \fBsocketdir\fR .RS 4 Unix socket directory for PostgeSQL .sp (optional, string, no default) .RE .PP \fBstop_escalate\fR .RS 4 Number of shutdown retries (using \-m fast) before resorting to \-m immediate .sp (optional, integer, default 30) .RE .PP \fBrep_mode\fR .RS 4 Replication mode(none(default)/async/sync)\&. "async" and "sync" require PostgreSQL 9\&.1 or later\&. If you use async or sync, it requires node_list, master_ip, restore_command parameters, and needs setting postgresql\&.conf, pg_hba\&.conf up for replication\&. Please delete "include /\&.\&./\&.\&./rep_mode\&.conf" line in postgresql\&.conf when you switch from sync to async\&. .sp (optional, string, default "none") .RE .PP \fBnode_list\fR .RS 4 All node names\&. Please separate each node name with a space\&. This is required for replication\&. .sp (optional, string, no default) .RE .PP \fBrestore_command\fR .RS 4 restore_command for recovery\&.conf\&. This is required for replication\&. .sp (optional, string, no default) .RE .PP \fBarchive_cleanup_command\fR .RS 4 archive_cleanup_command for recovery\&.conf\&. This is used for replication and is optional\&. .sp (optional, string, no default) .RE .PP \fBrecovery_end_command\fR .RS 4 recovery_end_command for recovery\&.conf\&. This is used for replication and is optional\&. .sp (optional, string, no default) .RE .PP \fBmaster_ip\fR .RS 4 Master\*(Aqs floating IP address to be connected from hot standby\&. This parameter is used for "primary_conninfo" in recovery\&.conf\&. This is required for replication\&. .sp (optional, string, no default) .RE .PP \fBrepuser\fR .RS 4 User used to connect to the master server\&. This parameter is used for "primary_conninfo" in recovery\&.conf\&. This is required for replication\&. .sp (optional, string, default "postgres") .RE .PP \fBprimary_conninfo_opt\fR .RS 4 primary_conninfo options of recovery\&.conf except host, port, user and application_name\&. This is optional for replication\&. .sp (optional, string, no default) .RE .PP \fBtmpdir\fR .RS 4 Path to temporary directory\&. This is optional for replication\&. .sp (optional, string, default "/var/lib/pgsql/tmp") .RE .PP \fBxlog_check_count\fR .RS 4 Number of checking xlog on monitor before promote\&. This is optional for replication\&. .sp (optional, integer, no default) .RE .PP \fBcrm_attr_timeout\fR .RS 4 The timeout of crm_attribute forever update command\&. Default value is 5 seconds\&. This is optional for replication\&. .sp (optional, integer, default 5) .RE .PP \fBstop_escalate_in_slave\fR .RS 4 Number of shutdown retries (using \-m fast) before resorting to \-m immediate in Slave state\&. This is optional for replication\&. .sp (optional, integer, default 30) .RE .SH "SUPPORTED ACTIONS" .PP This resource agent supports the following actions (operations): .PP \fBstart\fR .RS 4 Starts the resource\&. Suggested minimum timeout: 120\&. .RE .PP \fBstop\fR .RS 4 Stops the resource\&. Suggested minimum timeout: 120\&. .RE .PP \fBstatus\fR .RS 4 Performs a status check\&. Suggested minimum timeout: 60\&. .RE .PP \fBmonitor\fR .RS 4 Performs a detailed status check\&. Suggested minimum timeout: 30\&. Suggested interval: 30\&. .RE .PP \fBmonitor (Master role)\fR .RS 4 Performs a detailed status check\&. Suggested minimum timeout: 30\&. Suggested interval: 29\&. .RE .PP \fBpromote\fR .RS 4 Promotes the resource to the Master role\&. Suggested minimum timeout: 120\&. .RE .PP \fBdemote\fR .RS 4 Demotes the resource to the Slave role\&. Suggested minimum timeout: 120\&. .RE .PP \fBnotify\fR .RS 4 Suggested minimum timeout: 90\&. .RE .PP \fBmeta\-data\fR .RS 4 Retrieves resource agent metadata (internal use only)\&. Suggested minimum timeout: 5\&. .RE .PP \fBvalidate\-all\fR .RS 4 Performs a validation of the resource configuration\&. Suggested minimum timeout: 5\&. .RE .PP \fBmethods\fR .RS 4 Suggested minimum timeout: 5\&. .RE .SH "EXAMPLE" .PP The following is an example configuration for a pgsql resource using the \fBcrm\fR(8) shell: .sp .if n \{\ .RS 4 .\} .nf primitive p_pgsql ocf:heartbeat:pgsql \e op monitor depth="0" timeout="30" interval="30" \e op monitor depth="0" timeout="30" interval="29" role="Master" .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf ms ms_pgsql p_pgsql \e meta notify="true" interleave="true" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \m[blue]\fB\%http://www.linux-ha.org/wiki/pgsql_(resource_agent)\fR\m[] .SH "AUTHOR" .PP \fBLinux\-HA contributors (see the resource agent source for information about individual authors)\fR