How can I set resource stickiness in pacemaker?
To display the current value of a specific cluster property, use the following command.
pcs property list --all
To display the current value of a specific cluster property, use the following command.
pcs property show property
To set the value of a cluster property, use the following pcs command.
pcs property set property=value
You can set the value of resource-stickiness
, a resource meta option that indicates how much the resource prefers to stay where it is (the default value is 0) for a given resource or group whith the following command:
# pcs resource meta resource_id resource-stickiness=100
For example:
# pcs resource meta dns_ip resource-stickiness=100
# pcs resource show dns_ip
Resource: dns_ip (class=ocf provider=heartbeat type=IPaddr2)
Attributes: ip=10.0.0.1 cidr_netmask=24
Meta Attrs: resource-stickiness=100
Operations: start interval=0s timeout=20s (dns_ip-start-timeout-20s)