1OCF_HEARTBEAT_PGSQL(7)        OCF resource agents       OCF_HEARTBEAT_PGSQL(7)
2
3
4

NAME

6       ocf_heartbeat_pgsql - Manages a PostgreSQL database instance
7

SYNOPSIS

9       pgsql [start | stop | status | monitor | promote | demote | meta-data |
10             validate-all]
11

DESCRIPTION

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

SUPPORTED PARAMETERS

17       pgctl
18           Path to pg_ctl command.
19
20           (optional, string, default "/usr/bin/pg_ctl")
21
22       start_opt
23           Start options (-o start_opt in pg_ctl). "-i -p 5432" for example.
24
25           (optional, string, no default)
26
27       ctl_opt
28           Additional pg_ctl options (-w, -W etc..).
29
30           (optional, string, no default)
31
32       psql
33           Path to psql command.
34
35           (optional, string, default "/usr/bin/psql")
36
37       pgdata
38           Path to PostgreSQL data directory.
39
40           (optional, string, default "/var/lib/pgsql/data")
41
42       pgdba
43           User that owns PostgreSQL.
44
45           (optional, string, default "postgres")
46
47       pghost
48           Hostname/IP address where PostgreSQL is listening
49
50           (optional, string, no default)
51
52       pgport
53           Port where PostgreSQL is listening
54
55           (optional, integer, default 5432)
56
57       monitor_user
58           PostgreSQL user that pgsql RA will user for monitor operations. If
59           it´s not set pgdba user will be used.
60
61           (optional, string, no default)
62
63       monitor_password
64           Password for monitor user.
65
66           (optional, string, no default)
67
68       monitor_sql
69           SQL script that will be used for monitor operations.
70
71           (optional, string, default "select now();")
72
73       config
74           Path to the PostgreSQL configuration file for the instance.
75
76           (optional, string, default "/var/lib/pgsql/data/postgresql.conf")
77
78       pgdb
79           Database that will be used for monitoring.
80
81           (optional, string, default "template1")
82
83       logfile
84           Path to PostgreSQL server log output file.
85
86           (optional, string, default "/dev/null")
87
88       socketdir
89           Unix socket directory for PostgreSQL
90
91           (optional, string, no default)
92
93       stop_escalate
94           Number of shutdown retries (using -m fast) before resorting to -m
95           immediate
96
97           (optional, integer, default 30)
98
99       rep_mode
100           Replication mode may be set to "async" or "sync" or "slave". They
101           require PostgreSQL 9.1 or later. Once set, "async" and "sync"
102           require node_list, master_ip, and restore_command parameters,as
103           well as configuring PostgreSQL for replication (in postgresql.conf
104           and pg_hba.conf).
105
106           "slave" means that RA only makes recovery.conf before starting to
107           connect to primary which is running somewhere. It dosen´t need
108           master/slave setting. It requires master_ip restore_command
109           parameters.
110
111           (optional, string, default "none")
112
113       node_list
114           All node names. Please separate each node name with a space. This
115           is required for replication.
116
117           (optional, string, no default)
118
119       restore_command
120           restore_command for recovery.conf. This is required for
121           replication.
122
123           (optional, string, no default)
124
125       archive_cleanup_command
126           archive_cleanup_command for recovery.conf. This is used for
127           replication and is optional.
128
129           (optional, string, no default)
130
131       recovery_end_command
132           recovery_end_command for recovery.conf. This is used for
133           replication and is optional.
134
135           (optional, string, no default)
136
137       master_ip
138           Master´s floating IP address to be connected from hot standby. This
139           parameter is used for "primary_conninfo" in recovery.conf. This is
140           required for replication.
141
142           (optional, string, no default)
143
144       repuser
145           User used to connect to the master server. This parameter is used
146           for "primary_conninfo" in recovery.conf. This is required for
147           replication.
148
149           (optional, string, default "postgres")
150
151       primary_conninfo_opt
152           primary_conninfo options of recovery.conf except host, port, user
153           and application_name. This is optional for replication.
154
155           (optional, string, no default)
156
157       restart_on_promote
158           If this is true, RA deletes recovery.conf and restarts PostgreSQL
159           on promote to keep Timeline ID. It probably makes fail-over slower.
160           It´s recommended to set on-fail of promote up as fence. This is
161           optional for replication.
162
163           (optional, boolean, default false)
164
165       tmpdir
166           Path to temporary directory. This is optional for replication.
167
168           (optional, string, default "/var/lib/pgsql/tmp")
169
170       xlog_check_count
171           Number of checks of xlog on monitor before promote. This is
172           optional for replication.
173
174           (optional, integer, no default)
175
176       crm_attr_timeout
177           The timeout of crm_attribute forever update command. Default value
178           is 5 seconds. This is optional for replication.
179
180           (optional, integer, default 5)
181
182       stop_escalate_in_slave
183           Number of shutdown retries (using -m fast) before resorting to -m
184           immediate in slave state. This is optional for replication.
185
186           (optional, integer, default 30)
187
188       check_wal_receiver
189           If this is true, RA checks wal_receiver process on monitor and
190           notifies its status using "(resource name)-receiver-status"
191           attribute. It´s useful for checking whether PostgreSQL (hot
192           standby) connects to primary. The attribute shows status as
193           "normal" or "ERROR".
194
195           (optional, boolean, default false)
196

SUPPORTED ACTIONS

198       This resource agent supports the following actions (operations):
199
200       start
201           Starts the resource. Suggested minimum timeout: 120.
202
203       stop
204           Stops the resource. Suggested minimum timeout: 120.
205
206       status
207           Performs a status check. Suggested minimum timeout: 60.
208
209       monitor
210           Performs a detailed status check. Suggested minimum timeout: 30.
211           Suggested interval: 30.
212
213       monitor (Master role)
214           Performs a detailed status check. Suggested minimum timeout: 30.
215           Suggested interval: 29.
216
217       promote
218           Promotes the resource to the Master role. Suggested minimum
219           timeout: 120.
220
221       demote
222           Demotes the resource to the Slave role. Suggested minimum timeout:
223           120.
224
225       notify
226           Suggested minimum timeout: 90.
227
228       meta-data
229           Retrieves resource agent metadata (internal use only). Suggested
230           minimum timeout: 5.
231
232       validate-all
233           Performs a validation of the resource configuration. Suggested
234           minimum timeout: 5.
235
236       methods
237           Suggested minimum timeout: 5.
238

EXAMPLE

240       The following is an example configuration for a pgsql resource using
241       the crm(8) shell:
242
243           primitive p_pgsql ocf:heartbeat:pgsql \
244             op monitor depth="0" timeout="30" interval="30" \
245             op monitor depth="0" timeout="30" interval="29" role="Master"
246
247           ms ms_pgsql p_pgsql \
248             meta notify="true" interleave="true"
249

SEE ALSO

251       http://www.linux-ha.org/wiki/pgsql_(resource_agent)
252

AUTHOR

254       Linux-HA contributors (see the resource agent source for information
255       about individual authors)
256
257
258
259resource-agents 3.9.2             03/24/2017            OCF_HEARTBEAT_PGSQL(7)
Impressum