我正在尝试使用corosync和心脏起搏器设置主动/被动(2个节点)Linux-HA集群,以保持PostgreSQL数据库的正常运行。它通过DRBD和service-ip起作用。如果node1发生故障,则node2应该接管。如果PG在node2上运行并且失败,则相同。除了STONITH之外,其他一切都正常。
节点之间是专用的HA连接(10.10.10.X),因此我具有以下接口配置:
eth0            eth1            host
10.10.10.251    172.10.10.1     node1
10.10.10.252    172.10.10.2     node2
Stonith已启用,我正在使用ssh-agent测试以杀死节点。
crm configure property stonith-enabled=true
crm configure property stonith-action=poweroff
crm configure rsc_defaults resource-stickiness=100
crm configure property no-quorum-policy=ignore
crm configure primitive stonith_postgres stonith:external/ssh \
                params hostlist="node1 node2"
crm configure clone fencing_postgres stonith_postgres
crm_mon -1 显示:
============
Last updated: Mon Mar 19 15:21:11 2012
Stack: openais
Current DC: node2 - partition with quorum
Version: 1.0.9-74392a28b7f31d7ddc86689598bd23114f58978b
2 Nodes configured, 2 expected votes
4 Resources configured.
============
Online: [ node2 node1 ]
Full list of resources:
 Master/Slave Set: ms_drbd_postgres
     Masters: [ node1 ]
     Slaves: [ node2 ]
 Resource Group: postgres
     fs_postgres        (ocf::heartbeat:Filesystem):    Started node1
     virtual_ip_postgres        (ocf::heartbeat:IPaddr2):       Started node1
     postgresql (ocf::heartbeat:pgsql): Started node1
 Clone Set: fencing_postgres
     Started: [ node2 node1 ]
问题是:当我断开eth0-interface之间的连接时,它将杀死两个节点。我认为仲裁有问题,因为只有2个节点。但我不想添加第3个节点,仅用于计算正确的仲裁。
有解决这个问题的想法吗?
crm_mon当群集处于故障状态时,输出会是什么样?