4
# Dummy OCF script for resource group
7
# Copyright (C) 1997-2003 Sistina Software, Inc. All rights reserved.
8
# Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
10
# This program is free software; you can redistribute it and/or
11
# modify it under the terms of the GNU General Public License
12
# as published by the Free Software Foundation; either version 2
13
# of the License, or (at your option) any later version.
15
# This program is distributed in the hope that it will be useful,
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
# GNU General Public License for more details.
20
# You should have received a copy of the GNU General Public License
21
# along with this program; if not, write to the Free Software
22
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
# Grab nfs lock tricks if available
27
if [ -f "$(dirname $0)/svclib_nfslock" ]; then
28
. $(dirname $0)/svclib_nfslock
36
<resource-agent version="rgmanager 2.0" name="service">
37
<version>1.0</version>
40
This defines a collection of resources, known as a resource
41
group or cluster service.
44
Defines a service (resource group).
48
<parameter name="name" unique="1" required="1" primary="1">
50
This is the name of the resource group.
55
<content type="string"/>
58
<parameter name="domain" reconfig="1">
60
Failover domains define lists of cluster members
61
to try in the event that a resource group fails.
66
<content type="string"/>
69
<parameter name="autostart" reconfig="1">
71
If set to yes, this resource group will automatically be started
72
after the cluster forms a quorum. If set to no, this resource
73
group will start in the 'disabled' state after the cluster forms
77
Automatic start after quorum formation
79
<content type="boolean" default="1"/>
82
<parameter name="exclusive" reconfig="1">
84
If set, this resource group will only relocate to
85
nodes which have no other resource groups running in the
86
event of a failure. If no empty nodes are available,
87
this resource group will not be restarted after a failure.
88
Additionally, resource groups will not automatically
89
relocate to the node running this resource group. This
90
option can be overridden by manual start and/or relocate
96
<content type="boolean" default="0"/>
99
<parameter name="nfslock">
101
Enable NFS lock workarounds. When used with a compatible
102
HA-callout program like clunfslock, this could be used
103
to provide NFS lock failover, but at significant cost to
104
other services on the machine. This requires a compatible
105
version of nfs-utils and manual configuration of rpc.statd;
106
see 'man rpc.statd' to see if your version supports
109
<shortdesc lang="en">
110
Enable NFS lock workarounds.
112
<content type="boolean" default="0"/>
115
<parameter name="nfs_client_cache">
117
On systems with large numbers of exports, a performance
118
problem in the exportfs command can cause inordinately long
119
status check times for services with lots of mounted
120
NFS clients. This occurs because exportfs does DNS queries
121
on all clients in the export list.
123
Setting this option to '1' will enable caching of the export
124
list returned from the exportfs command on a per-service
125
basis. The cache will last for 30 seconds before expiring
126
instead of being generated each time an nfsclient resource
129
<shortdesc lang="en">
130
Enable exportfs list caching (performance).
132
<content type="integer" default="0"/>
136
<parameter name="recovery" reconfig="1">
138
This currently has three possible options: "restart" tries
139
to restart failed parts of this resource group locally before
140
attempting to relocate (default); "relocate" does not bother
141
trying to restart the service locally; "disable" disables
142
the resource group if any component fails. Note that
143
any resource with a valid "recover" operation which can be
144
recovered without a restart will be.
146
<shortdesc lang="en">
147
Failure recovery policy (restart, relocate, or disable).
149
<content type="string" default="restart"/>
152
<parameter name="depend">
154
Service dependency; will not start without the specified
157
<shortdesc lang="en">
158
Top-level service this depends on, in service:name format.
160
<content type="string"/>
163
<parameter name="depend_mode">
165
Service dependency mode.
166
hard - This service is stopped/started if its dependency
168
soft - This service only depends on the other service for
169
initial startip. If the other service stops, this
170
service is not stopped.
172
<shortdesc lang="en">
173
Service dependency mode (soft or hard).
175
<content type="string" default="hard"/>
178
<parameter name="max_restarts">
180
Maximum restarts for this service.
182
<shortdesc lang="en">
183
Maximum restarts for this service.
185
<content type="string" default="0"/>
188
<parameter name="restart_expire_time">
190
Restart expiration time. A restart is forgotten
191
after this time. When combined with the max_restarts
192
option, this lets administrators specify a threshold
193
for when to fail over services. If max_restarts
194
is exceeded in this given expiration time, the service
195
is relocated instead of restarted again.
197
<shortdesc lang="en">
198
Restart expiration time; amount of time before a restart
201
<content type="string" default="0"/>
204
<parameter name="priority">
206
Priority for the service. In a failover scenario, this
207
indicates the ordering of the service (1 is processed
208
first, 2 is processed second, etc.). This overrides the
209
order presented in cluster.conf. This option only has
210
an effect if central processing within rgmanager is turned
213
<shortdesc lang="en">
216
<content type="integer" default="0"/>
222
<action name="start" timeout="5"/>
223
<action name="stop" timeout="5"/>
225
<!-- No-ops. Groups are abstract resource types.
226
<action name="status" timeout="5" interval="1h"/>
227
<action name="monitor" timeout="5" interval="1h"/>
230
<action name="reconfig" timeout="5"/>
231
<action name="recover" timeout="5"/>
232
<action name="reload" timeout="5"/>
233
<action name="meta-data" timeout="5"/>
234
<action name="validate-all" timeout="5"/>
237
<special tag="rgmanager">
238
<attributes maxinstances="1"/>
239
<child type="lvm" start="1" stop="9"/>
240
<child type="fs" start="2" stop="8"/>
241
<child type="clusterfs" start="3" stop="7"/>
242
<child type="netfs" start="4" stop="6"/>
243
<child type="nfsexport" start="5" stop="5"/>
245
<child type="nfsclient" start="6" stop="4"/>
247
<child type="ip" start="7" stop="2"/>
248
<child type="smb" start="8" stop="3"/>
249
<child type="script" start="9" stop="1"/>
257
# A Resource group is abstract, but the OCF RA API doesn't allow for abstract
258
# resources, so here it is.
263
# XXX If this is set, we kill lockd. If there is no
264
# child IP address, then clients will NOT get the reclaim
267
if [ $NFS_TRICKS -eq 0 ]; then
268
if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
269
[ "$OCF_RESKEY_nfslock" = "1" ]; then