0

是否可以配置 Pacemaker 资源组,以便在调用任何操作(监控、启动、停止可能被忽略)时资源超时,集群管理器会将资源迁移到备用节点?如果Standby节点再次出现问题,它会将资源带回Primary节点等。它将继续重试5小时甚至无限期。

在外部系统关闭的实际情况下,保持重述是使服务尽快恢复可用的唯一方法。

长话短说:我正在为 OCI 公共和私有 IP 构建资源管理器。在 Oracle Cloud 中分配浮动可路由 IP 和内部 IP 需要与 OCI API 交互来配置虚拟网络侧。我遵循了 Dummy 示例代码;几乎没有错误,最终将代码传递给生产。资源组如下所示:浮动 IP、路由和 systemd 服务。我已将迁移阈值配置为 5,将资源粘性配置为 100。

 Resource Group: libreswan
 ipsec_cluster_routing_no1  (ocf::heartbeat:Route): Started node1
 ipsec_cluster_public_ip    (ocf::heartbeat:oci_publicip):  Started node1
 ipsec_cluster_private_ip_no1   (ocf::heartbeat:oci_privateip): Started node1
 ipsec_cluster_private_ip_no2   (ocf::heartbeat:oci_privateip): Started node1
 ipsec_cluster_inet_ip_no1  (ocf::heartbeat:IPaddr2):   Started node1
 ipsec_cluster_inet_ip_no2  (ocf::heartbeat:IPaddr2):   Started node1
 ipsec_cluster_routing_no2  (ocf::heartbeat:Route): Started node1
 ipsec_cluster_libreswan    (systemd:ipsec):    Started node1

最近由于 OCI API 暂时不可用,集群管理器由于 30 秒而停止了整个资源组。对 oci_privateip 资源之一的 monitor() 操作超时。

在日志中,我看到 5 次重试顺序:监控、停止、启动。但是在该集群管理器放弃之后,使资源处于已停止状态。我希望集群管理器继续重试。

4

1 回答 1

0

解决了。

  sudo pcs resource meta $res failure-timeout=120
  sudo pcs resource meta $res migration-threshold=5

使“失败”节点准备好在 120 秒后收回资源。放弃前失败的节点将重试 5 次,因此 30 秒超时将继续重试 2.5 分钟。

更多信息:https ://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/configuring_the_red_hat_high_availability_add-on_with_pacemaker/s1-resourceopts-haar

于 2020-05-07T13:53:28.867 回答