Show Table of Contents
7.3. 由于连接更改而移动资源
将集群设定为在丧失外部连接后移动资源,这是一个两步的过程。
- 在集群中添加
ping资源。ping资源使用同名的系统程序测试是否可连接到一组机器(由 DNS、主机名或 IPv4 地址指定),并使用所得结果维护节点属性pingd。 - 为资源配置位置限制,以便在连接丧失后将该资源移动到不同的节点。
表 5.1 “资源属性” 论述了可为
ping 资源设定的属性。
表 7.1. Ping 资源属性
以下示例命令创建了
ping 资源,用来确认与 www.example.com 连接性的 。在实践中,可以确认网络网关/路由器的连接性。将 ping 资源配置为克隆,以便在所有集群节点中都可以运行。
# pcs resource create ping ocf:pacemaker:ping dampen=5s multiplier=1000 host_list=www.example.com --clone
以下示例为名为
Webserver 的现有资源配置了位置限制。这样就会在其目前所运行的主机无法 ping www.example.com 时,将 Webserver 资源移至能够 ping www.example.com 的主机中。
# pcs constraint location Webserver rule score=-INFINITY pingd lt 1 or not_defined pingd
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.