Stonith - the kill other node. But I need another.
So that a node can not become a master if it is not connected to network.
I solved my question by increasing the parameter token in corosync.conf
default token value: 3000. New value: 30000.
And then the rule (location location_master_ms_drbd1 ms_drbd1 rule $role=Master -inf: not_defined pingd or pingd lte 0) has time to work correctly.

Thanks to Adrián Gómez <[email protected]> for his question, which turned out to be a response to my.


On 19.12.2017 13:00, emmanuel segura wrote:
You need to configure the stonith and drbd stonith handler

2017-12-19 8:19 GMT+01:00 Прокопов Павел <[email protected] <mailto:[email protected]>>:

    Hello!

    pacemaker pingd with ms drbd = double masters short time when
    disconnected networks.

    My crm config:

    node 168885811 <tel:168885811>: pp-pacemaker1.heliosoft.ru
    <http://pp-pacemaker1.heliosoft.ru>
    node 168885812 <tel:168885812>: pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru>
    primitive drbd1 ocf:linbit:drbd \
        params drbd_resource=drbd1 \
        op monitor interval=60s \
        op start interval=15 timeout=240s \
        op stop interval=15 timeout=240s \
        op monitor role=Master interval=30s \
        op monitor role=Slave interval=60s
    primitive fs_drbd1 Filesystem \
        params device="/dev/drbd1" directory="/mnt/drbd1" fstype=ext4
    options=noatime
    primitive pinger ocf:pacemaker:ping \
        params host_list=10.16.4.1 multiplier=100 \
        op monitor interval=15s \
        op start interval=0 timeout=5s \
        op stop interval=0
    primitive vip IPaddr2 \
        params ip=10.16.5.227 nic=eth0 \
        op monitor interval=10s
    primitive vip2 IPaddr2 \
        params ip=10.16.254.50 nic=eth1 \
        op monitor interval=10s
    group group_master fs_drbd1 vip vip2
    ms ms_drbd1 drbd1 \
        meta master-max=1 master-node-max=1 clone-max=2
    clone-node-max=1 notify=true
    clone pingerclone pinger \
        meta globally-unique=false
    colocation colocation_master inf: ms_drbd1:Master group_master
    location location_master_ms_drbd1 ms_drbd1 \
        rule $role=Master -inf: not_defined pingd or pingd lte 0
    order main_order Mandatory: pingerclone:start ms_drbd1:promote
    group_master:start
    property cib-bootstrap-options: \
        stonith-enabled=false \
        no-quorum-policy=ignore \
        default-resource-stickiness=500 \
        cluster-name=pp1

    root@pp-pacemaker2:~# crm_mon -1
    Stack: corosync
    Current DC: pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> (version 1.1.16-94ff4df) -
    partition with quorum
    Last updated: Fri Dec 15 13:48:10 2017
    Last change: Fri Dec 15 13:46:38 2017 by root via cibadmin on
    pp-pacemaker1.heliosoft.ru <http://pp-pacemaker1.heliosoft.ru>

    2 nodes configured
    7 resources configured

    Online: [ pp-pacemaker1.heliosoft.ru
    <http://pp-pacemaker1.heliosoft.ru> pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> ]

    Active resources:

     Resource Group: group_master
         fs_drbd1    (ocf::heartbeat:Filesystem): Started
    pp-pacemaker1.heliosoft.ru <http://pp-pacemaker1.heliosoft.ru>
         vip    (ocf::heartbeat:IPaddr2):    Started
    pp-pacemaker1.heliosoft.ru <http://pp-pacemaker1.heliosoft.ru>
         vip2    (ocf::heartbeat:IPaddr2):    Started
    pp-pacemaker1.heliosoft.ru <http://pp-pacemaker1.heliosoft.ru>
     Master/Slave Set: ms_drbd1 [drbd1]
         Masters: [ pp-pacemaker1.heliosoft.ru
    <http://pp-pacemaker1.heliosoft.ru> ]
         Slaves: [ pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> ]
     Clone Set: pingerclone [pinger]
         Started: [ pp-pacemaker1.heliosoft.ru
    <http://pp-pacemaker1.heliosoft.ru> pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> ]
    #end crm_mon

    When I disconnect pp-pacemaker2 from all networks, I have:
    root@pp-pacemaker2:~# crm_mon -1
    Stack: corosync
    Current DC: pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> (version 1.1.16-94ff4df) -
    partition with quorum
    Last updated: Fri Dec 15 13:53:15 2017
    Last change: Fri Dec 15 13:53:00 2017 by root via cibadmin on
    pp-pacemaker2.heliosoft.ru <http://pp-pacemaker2.heliosoft.ru>

    2 nodes configured
    7 resources configured

    Online: [ pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru>]
    OFFLINE: [pp-pacemaker1.heliosoft.ru
    <http://pp-pacemaker1.heliosoft.ru> ]

    Active resources:

     Resource Group: group_master
         fs_drbd1    (ocf::heartbeat:Filesystem): Started
    pp-pacemaker2.heliosoft.ru <http://pp-pacemaker2.heliosoft.ru>
         vip    (ocf::heartbeat:IPaddr2):    Started
    pp-pacemaker2.heliosoft.ru <http://pp-pacemaker2.heliosoft.ru>
         vip2    (ocf::heartbeat:IPaddr2):    Started
    pp-pacemaker2.heliosoft.ru <http://pp-pacemaker2.heliosoft.ru>
     Master/Slave Set: ms_drbd1 [drbd1]
         Masters: [ pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> ]
     Clone Set: pingerclone [pinger]
         Started: [ pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> ]
    #end crm_mon

    Wait 5 seconds.

    root@pp-pacemaker2:~# crm_mon -1
    Stack: corosync
    Current DC: pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> (version 1.1.16-94ff4df) -
    partition with quorum
    Last updated: Fri Dec 15 13:48:10 2017
    Last change: Fri Dec 15 13:46:38 2017 by root via cibadmin on
    pp-pacemaker1.heliosoft.ru <http://pp-pacemaker1.heliosoft.ru>

    2 nodes configured
    7 resources configured

    Online: [ pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru>
    OFFLINE: [pp-pacemaker1.heliosoft.ru
    <http://pp-pacemaker1.heliosoft.ru> ]

    Active resources:

     Master/Slave Set: ms_drbd1 [drbd1]
         Slaves: [ pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> ]
     Clone Set: pingerclone [pinger]
         Started: [ pp-pacemaker2.heliosoft.ru
    <http://pp-pacemaker2.heliosoft.ru> ]
    #end crm_mon

    Why pp-pacemaker2 first become a master? It breaks drdb.




    _______________________________________________
    Users mailing list: [email protected]
    <mailto:[email protected]>
    http://lists.clusterlabs.org/mailman/listinfo/users
    <http://lists.clusterlabs.org/mailman/listinfo/users>

    Project Home: http://www.clusterlabs.org
    Getting started:
    http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
    <http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf>
    Bugs: http://bugs.clusterlabs.org




--
.~.
  /V\
 //  \\
/(   )\
^`~'^


_______________________________________________
Users mailing list: [email protected]
http://lists.clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org

--
Павел Прокопов
Старший системный администратор
Отдел системного администрирования


Адрес: 109004, Москва,
Большой факельный переулок, д. 3, стр. 2,
3 этаж
Тел.: +7 (495) 783-66-03, доб. 1143
Факс: +7 (495) 789-89-58
Почта: [email protected] <mailto:[email protected]>
Сайт: www.experium.ru <http://www.experium.ru>

_______________________________________________
Users mailing list: [email protected]
http://lists.clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org

Reply via email to