Pacemaker Cookbook
Pacemaker Cookbook
Srini Rao
luksOpenLvm
Luks LVM open resource for lvm that has setup with Luks
Filesystem
nfs-server
LVM
Srini Rao
Started nfs3
lvm_iscsi4
(ocf::heartbeat:LVM):
Started nfs3
fs-vg_iscsi4-lv_iscsi4
(ocf::heartbeat:Filesystem): Started nfs3
pseudo-vg_iscsi4-lv_iscsi4
(ocf::heartbeat:Filesystem): Started nfs3
Create a resource
To create a new resource
#pcs resource create fs-vg_iscsi7-lv_iscsi7 ocf:heartbeat:Filesystem
device=/dev/mapper/vg_iscsi7-lv_iscsi7 directory=/iscsi7 fstype=xfs
fast_stop="no" force_unmount="safe" op stop on-fail=stop timeout=200 op monitor onfail=stop timeout=200 OCF_CHECK_LEVEL=10
Delete a resource
To delete a resource
[A3][root@nfs3 ~]# pcs delete resource fs-vg_iscsi7-lv_iscsi7
Note: You can also use the move command to move resource back to its origional node, however, it
won't clear the constraint that move command generated. Thus, it's better to use 'resource clear' to move
back to its normal status.
Srini Rao
Note2: When moving a resource, any other resources that has constraint to the resource to be moved
will get moved too.
The command above defines the resource fs-vg_iscsi7-lv_iscsi7 to move after 3 failures.
Note: after a resource move due to failure, it will not run on the origional node until the failcount is
reset, or failure timeout reached.
To set all resource threshold to 3, so all resources in the cluster will move after 3 times fails
# pcs resource defaults migration-threshold=10
Note: the threshold only works when in normal mode, not for start and stop operation.
Start failures cause the failcount to be set to INFINITY and thus always cause the resource to move
immediately.
Stop failures are slightly different and crucial. If a resource fails to stop and STONITH is enabled, then
the cluster will fence the node in order to be able to start the resource elsewhere. If STONITH is not
enabled, then the cluster has no way to continue and will not try to start the resource elsewhere, but will
try to stop it again after the failure timeout.
To start a nfs-server resource on a node and back the resource to normal state
#pcs resource enabled nfs-server
Srini Rao
Managed Resources
To set a resource to unmanaged state, compare to the resource deletion, unmanaged resource is still in
the cluster configuration, but pacemaker doesn't manage it.
#pcs resource unmanage nfs-server