7.3. Moving Resources Due to Connectivity Changes
- Add a
pingresource to the cluster. The
pingresource uses the system utility of the same name to test if a list of machines (specified by DNS host name or IPv4/IPv6 address) are reachable and uses the results to maintain a node attribute called
- Configure a location constraint for the resource that will move the resource to a different node when connectivity is lost.
Table 7.1. Properties of a ping resources
pingresource that verifies connectivity to
www.example.com. In practice, you would verify connectivity to your network gateway/router. You configure the
pingresource as a clone so that the resource will run on all cluster nodes.
pcs resource create ping ocf:pacemaker:ping dampen=5s multiplier=1000 host_list=www.example.com --clone
Webserver. This will cause the
Webserverresource to move to a host that is able to ping
www.example.comif the host that it is currently running on cannot ping
pcs constraint location Webserver rule score=-INFINITY pingd lt 1 or not_defined pingd