Pacemaker Corosync Drbd Drbd braucht zu lange beim switch vom Master zum Slave

alias

New Member
Hallo ich habe einen Webserver (Apache Mysql ) versucht mit Pacemaker Corosync und DRBD, Hochverfügbar zu machen. Das hat auch sehr gut geklappt:D.
Fällt ein Dienst aus zieht der gesamte Knoten auf den zweiten um.Apache und die Ip brauchen nur 1s.
Aber Drbd braucht fast 8s. Um vom Master zum Slave zu switchen.
Wie kann ich dies beschleunigen?
Hier meine drbd.conf
Code:
drbd.conf
common {
   syncer {  rate 100M;}
}
resource r0 {
protocol C;
handlers {
pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
}
startup {
degr-wfc-timeout 120;   #2 Minuten
}
disk {
on-io-error detach;
}
net {
after-sb-0pri disconnect;
after-sb-1pri consensus;
after-sb-2pri disconnect;
rr-conflict disconnect;
}
syncer {
rate 100M;
al-extents 257;
}
on web1 {
device /dev/drbd0;
disk   /dev/sda3;
address 192.168.1.157:7788;
meta-disk internal;
}
on web2 {
device /dev/drbd0;
disk   /dev/sda3;
address 192.168.1.156:7788;
meta-disk internal;
   }
}

Hier meine XML.
Code:
<resources>
      <primitive class="ocf" id="resIP" provider="heartbeat" type="IPaddr2">
        <meta_attributes id="resIP-meta_attributes">
          <nvpair id="resIP-meta_attributes-target-role" name="target-role" value="started"/>
        </meta_attributes>
        <operations id="resIP-operations">
          <op id="resIP-op-monitor-5s" interval="5s" name="monitor" on-fail="restart" start-delay="6s" timeout="7s"/>
          <op id="resIP-op-monitor-10s" interval="10s" name="monitor" on-fail="standby" start-delay="11s" timeout="12s"/>
        </operations>
        <instance_attributes id="resIP-instance_attributes">
          <nvpair id="resIP-instance_attributes-ip" name="ip" value="192.168.1.161"/>
          <nvpair id="resIP-instance_attributes-nic" name="nic" value="eth0"/>
          <nvpair id="resIP-instance_attributes-cidr_netmask" name="cidr_netmask" value="24"/>
        </instance_attributes>
      </primitive>
      <primitive class="ocf" id="resFilesys" provider="heartbeat" type="Filesystem">
        <meta_attributes id="resFilesys-meta_attributes">
          <nvpair id="resFilesys-meta_attributes-target-role" name="target-role" value="stopped"/>
        </meta_attributes>
        <operations id="resFilesys-operations">
          <op id="resFilesys-op-monitor-10s" interval="10s" name="monitor" on-fail="standby" start-delay="11s" timeout="12s"/>
        </operations>
        <instance_attributes id="resFilesys-instance_attributes">
          <nvpair id="resFilesys-instance_attributes-device" name="device" value="/dev/drbd0"/>
          <nvpair id="resFilesys-instance_attributes-directory" name="directory" value="/mnt"/>
          <nvpair id="resFilesys-instance_attributes-fstype" name="fstype" value="ext3"/>
        </instance_attributes>
      </primitive>
      <primitive class="lsb" id="mysql2" type="mysql">
        <meta_attributes id="mysql2-meta_attributes">
          <nvpair id="mysql2-meta_attributes-target-role" name="target-role" value="started"/>
        </meta_attributes>
        <operations id="mysql2-operations">
          <op id="mysql2-op-monitor-5s" interval="5s" name="monitor" on-fail="restart" start-delay="6s" timeout="7s"/>
          <op id="mysql2-op-monitor-10s" interval="10s" name="monitor" on-fail="standby" start-delay="11s" timeout="12s"/>
        </operations>
      </primitive>
      <primitive class="lsb" id="resApache" type="apache2">
        <meta_attributes id="resApache-meta_attributes">
          <nvpair id="resApache-meta_attributes-target-role" name="target-role" value="started"/>
        </meta_attributes>
        <operations id="resApache-operations">
          <op id="resApache-op-monitor-5s" interval="5s" name="monitor" on-fail="restart" start-delay="6s" timeout="7s"/>
          <op id="resApache-op-monitor-10s" interval="10s" name="monitor" on-fail="standby" start-delay="11s" timeout="12s"/>
        </operations>
      </primitive>
      <master id="msDRBD">
        <meta_attributes id="msDRBD-meta_attributes">
          <nvpair id="msDRBD-meta_attributes-notify" name="notify" value="true"/>
          <nvpair id="msDRBD-meta_attributes-target-role" name="target-role" value="started"/>
          <nvpair id="msDRBD-meta_attributes-clone-max" name="clone-max" value="2"/>
          <nvpair id="msDRBD-meta_attributes-clone-node-max" name="clone-node-max" value="1"/>
          <nvpair id="msDRBD-meta_attributes-master-max" name="master-max" value="1"/>
          <nvpair id="msDRBD-meta_attributes-master-node-max" name="master-node-max" value="1"/>
          <nvpair id="msDRBD-meta_attributes-notify-0" name="notify" value="true"/>
          <nvpair id="msDRBD-meta_attributes-globally-unique" name="globally-unique" value="false"/>
        </meta_attributes>
        <primitive class="ocf" id="resDRBD" provider="heartbeat" type="drbd">
          <operations id="resDRBD-operations">
            <op id="resDRBD-op-monitor-Slave-20" interval="20" name="monitor" role="Slave" timeout="20"/>
            <op id="resDRBD-op-monitor-Master-10" interval="10" name="monitor" role="Master" timeout="20"/>
          </operations>
          <instance_attributes id="resDRBD-instance_attributes">
            <nvpair id="resDRBD-instance_attributes-drbd_resource" name="drbd_resource" value="r0"/>
          </instance_attributes>
        </primitive>
      </master>
    </resources>
Code:
<constraints>
      <rsc_location id="locIP" node="web1" rsc="resIP" score="100"/>
      <rsc_order first="resFilesys" first-action="start" id="ordermysql" then="mysql2"/>
      <rsc_location id="locmysql" node="web1" rsc="mysql2" score="100"/>
      <rsc_location id="locapache" node="web1" rsc="resApache" score="100"/>
      <rsc_colocation id="colFSDRBD" rsc="resFilesys" score="INFINITY" with-rsc="msDRBD" with-rsc-role="Master"/>
      <rsc_order first="msDRBD" first-action="promote" id="orderDRBDFS" then="resFilesys" then-action="start"/>
      <rsc_location id="locmsDRBD" node="web1" rsc="msDRBD" score="100"/>
    </constraints>

Das ganze funktioniert sehr gut, aber der umzug vom Knoten1 zu Knoten2 dauert dank Drbd 8s, genauer gesagt braucht drbd so lange um vom Slave zum Master zu werden. Alles andere braucht knapp 1s um auf den zweiten Knoten umzuziehen. Und 8s unterbrechung finde ich schon viel:eek:
 
Last edited by a moderator:
Back
Top