Colocate pacemaker Recursos mestres com recursos apátridas

2

Eu implementei um cluster simples de dois nós com o DRBD e alguns recursos Mestre / Escravo baseados em rede.

Usando o ethmonitor RA, configuro o failover sempre que o nó Principal / Principal perder o link no dispositivo físico Ethernet especificado, restringindo a função do Mestre apenas nos nós nos quais a variável ethmon é "1".

Algo está dando errado com minha restrição de colocation, no entanto - se eu configurar o recurso DRBDFS para monitorar o link em eth1, desconectar eth1 no nó Primário causará um failover como esperado - todos os recursos Master serão rebaixados para "escravo" e promovidos no nó oposto, e o DRBDFS "normal" se move para o outro nó como esperado.

No entanto, se eu colocar a mesma restrição ethmonitor no recurso Mestre / Escravo baseado em rede, somente esse recurso específico falhará - o DRBDFS permanece no mesmo local (embora ele pare) como os outros recursos Mestre / Escravo. / p>

Isso cheira como um problema de restrição para mim - alguém sabe o que eu estou fazendo errado?

PCS antes:

Cluster name: node1.hostname.com_node2.hostname.com
Stack: corosync
Current DC: node2.hostname.com_0 (version 1.1.16-12.el7_4.4-94ff4df) - partition with quorum
Last updated: Tue Mar 20 16:25:47 2018
Last change: Tue Mar 20 16:00:33 2018 by hacluster via crmd on node2.hostname.com_0

2 nodes configured
11 resources configured

Online: [ node1.hostname.com_0 node2.hostname.com_0 ]

Full list of resources:

 Master/Slave Set: drbd.master [drbd.slave]
     Masters: [ node1.hostname.com_0 ]
     Slaves: [ node2.hostname.com_0 ]
 drbdfs (ocf::heartbeat:Filesystem):    Started node1.hostname.com_0
 Master/Slave Set: inside-interface-sameip.master [inside-interface-sameip.slave]
     Masters: [ node1.hostname.com_0 ]
     Slaves: [ node2.hostname.com_0 ]
 Master/Slave Set: outside-interface-sameip.master [outside-interface-sameip.slave]
     Masters: [ node1.hostname.com_0 ]
     Slaves: [ node2.hostname.com_0 ]
 Clone Set: monitor-eth1-clone [monitor-eth1]
     Started: [ node1.hostname.com_0 node2.hostname.com_0 ]
 Clone Set: monitor-eth2-clone [monitor-eth2]
     Started: [ node1.hostname.com_0 node2.hostname.com_0 ]

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: inactive/disabled

PCS após:

Cluster name: node1.hostname.com_node2.hostname.com
Stack: corosync
Current DC: node2.hostname.com_0 (version 1.1.16-12.el7_4.4-94ff4df) - partition with quorum
Last updated: Tue Mar 20 16:29:40 2018
Last change: Tue Mar 20 16:00:33 2018 by hacluster via crmd on node2.hostname.com_0

2 nodes configured
11 resources configured

Online: [ node1.hostname.com_0 node2.hostname.com_0 ]

Full list of resources:

 Master/Slave Set: drbd.master [drbd.slave]
     Masters: [ node1.hostname.com_0 ]
     Slaves: [ node2.hostname.com_0 ]
 drbdfs (ocf::heartbeat:Filesystem):    Stopped
 Master/Slave Set: inside-interface-sameip.master [inside-interface-sameip.slave]
     Masters: [ node2.hostname.com_0 ]
     Stopped: [ node1.hostname.com_0 ]
 Master/Slave Set: outside-interface-sameip.master [outside-interface-sameip.slave]
     Masters: [ node1.hostname.com_0 ]
     Slaves: [ node2.hostname.com_0 ]
 Clone Set: monitor-eth1-clone [monitor-eth1]
     Started: [ node1.hostname.com_0 node2.hostname.com_0 ]
 Clone Set: monitor-eth2-clone [monitor-eth2]
     Started: [ node1.hostname.com_0 node2.hostname.com_0 ]

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: inactive/disabled

Esta é a seção "restrições" do meu CIB:

<constraints>
    <rsc_colocation id="pcs_rsc_colocation_set_drbdfs_set_drbd.master_inside-interface-sameip.master_outside-interface-sameip.master" score="INFINITY">
        <resource_set id="pcs_rsc_set_drbdfs" sequential="false">
            <resource_ref id="drbdfs"/>
        </resource_set>
        <resource_set id="pcs_rsc_set_drbd.master_inside-interface-sameip.master_outside-interface-sameip.master" role="Master" sequential="false">
            <resource_ref id="drbd.master"/>
            <resource_ref id="inside-interface-sameip.master"/>
            <resource_ref id="outside-interface-sameip.master"/>
        </resource_set>
    </rsc_colocation>
    <rsc_order id="pcs_rsc_order_set_drbd.master_inside-interface-sameip.master_outside-interface-sameip.master_set_drbdfs" kind="Serialize" symmetrical="false">
        <resource_set action="promote" id="pcs_rsc_set_drbd.master_inside-interface-sameip.master_outside-interface-sameip.master-1" role="Master">
            <resource_ref id="drbd.master"/>
            <resource_ref id="inside-interface-sameip.master"/>
            <resource_ref id="outside-interface-sameip.master"/>
        </resource_set>
        <resource_set id="pcs_rsc_set_drbdfs-1">
            <resource_ref id="drbdfs"/>
        </resource_set>
    </rsc_order>
    <rsc_location id="location-inside-interface-sameip.master" rsc="inside-interface-sameip.master">
        <rule id="location-inside-interface-sameip.master-rule" score="-INFINITY">
            <expression attribute="ethmon_result-eth1" id="location-inside-interface-sameip.master-rule-expr" operation="ne" value="1"/>
        </rule>
    </rsc_location>
    <rsc_location id="location-outside-interface-sameip.master" rsc="outside-interface-sameip.master">
        <rule id="location-outside-interface-sameip.master-rule" score="-INFINITY">
            <expression attribute="ethmon_result-eth2" id="location-outside-interface-sameip.master-rule-expr" operation="ne" value="1"/>
        </rule>
    </rsc_location>
</constraints>
    
por javanix 22.03.2018 / 21:53

0 respostas