HA-Cluster/corosync/pacemaker:具有服务 ip 的主动-主动集群/服务 ip 未切换

HA-Cluster/corosync/pacemaker:具有服务 ip 的主动-主动集群/服务 ip 未切换

如果一项服务失败,如何配置 crm 迁移 ServiceIP?

node 1: web01a \
    attributes standby=off
node 2: web01b \
    attributes standby=off
primitive Apache2 systemd:apache2 \
    operations $id=Apache2-operations \
    op start interval=0 timeout=100 \
    op stop interval=0 timeout=100 \
    op monitor interval=15 timeout=100 start-delay=15 \
    meta
primitive PHP-FPM systemd:php7.4-fpm \
    operations $id=PHP-FPM-operations \
    op start interval=0 timeout=100 \
    op stop interval=0 timeout=100 \
    op monitor interval=15 timeout=100 start-delay=15 \
    meta
primitive Redis systemd:redis-server \
    operations $id=Redis-operations \
    op start interval=0 timeout=100 \
    op stop interval=0 timeout=100 \
    op monitor interval=15 timeout=100 start-delay=15 \
    meta
primitive ServiceIP IPaddr2 \
    params ip=1.2.3.4 \
    operations $id=ServiceIP-operations \
    op monitor interval=10 timeout=20 start-delay=0 \
    op_params migration-threshold=1 \
    meta
primitive lsyncd systemd:lsyncd \
    op start interval=0 timeout=100 \
    op stop interval=0 timeout=100 \
    op monitor interval=15 timeout=100 start-delay=15 \
    meta target-role=Started
group ActiveNode ServiceIP lsyncd
group WebServer Apache2 PHP-FPM Redis
clone cl_WS WebServer \
    meta clone-max=2 notify=true interleave=true
colocation col_cl_WS_ActiveNode 100: cl_WS ActiveNode
property cib-bootstrap-options: \
    have-watchdog=false \
    dc-version=2.0.3-4b1f869f0f \
    cluster-infrastructure=corosync \
    cluster-name=debian \
    stonith-enabled=false \
    no-quorum-policy=ignore \
    startup-fencing=false \
    maintenance-mode=false \
    last-lrm-refresh=1622628525 \
    start-failure-is-fatal=true

这些服务应该始终启动

  • 阿帕奇2
  • PHP-FPM
  • 雷迪斯

如果其中一项服务未运行,则该节点不健康。这服务IP同步应该切换到健康的节点。

当我杀死apache2进程时,IP没有切换。

相关内容