<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta name="Generator" content="Zarafa WebAccess v6.40.8-27223">
  <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
  <title>RE: [Pacemaker] Resource starts on wrong node ?</title>
  <style type="text/css">
      body
      {
        font-family: Arial, Verdana, Sans-Serif ! important;
        font-size: 12px;
        padding: 5px 5px 5px 5px;
        margin: 0px;
        border-style: none;
        background-color: #ffffff;
      }

      p, ul, li
      {
        margin-top: 0px;
        margin-bottom: 0px;
      }
  </style>
</head>
<body>
<p> <br /> Dan,</p><p> </p><p>Thanks again.</p><p> </p><p>I'll go ahead and build the sources. I've done this previously on Ubuntu.</p><p>Shouldn't be all that different on Centos.</p><p> </p><p>And yes, for the time being I'm building an active/passive cluster, so for now I'll stick to using</p><p>colocation and ordering.</p><p> </p><p>Thanks,</p><p> </p><p>Hans</p><blockquote style="padding-left: 5px; margin-left: 5px; border-left: #325fba 2px solid">-----Original message-----<br /><strong>To:</strong> The Pacemaker cluster resource manager <pacemaker@oss.clusterlabs.org>; <br /><strong>From:</strong> Dan Frincu <df.cluster@gmail.com><br /><strong>Sent:</strong> Wed 21-09-2011 14:28<br /><strong>Subject:</strong> Re: [Pacemaker] Resource starts on wrong node ?<br />Hi,<br /><br />On Wed, Sep 21, 2011 at 3:03 PM, Hans Lammerts <j.lammerts@chello.nl> wrote:<br />>  Dan,<br />><br />><br />><br />> Thanks for the swift reply.<br />><br />> I didn't know pacemaker was sort of loadbalancing across nodes.<br />><br />> Maybe I should read the documentation in more detail.<br />><br />><br />><br />> Regarding the versions:<br />><br />> I would like to have the newest versions, but what I've done until now is<br />> just install what's available<br />><br />> from the Centos repositories.<br />><br />> Indeed I would like to upgrade since I also sometimes experience the issue<br />> that several heartbeat daemons<br />><br />> start looping when I change something in the config. Something that's<br />> supposed to be fixed in a higher level<br />><br />> of corosync/heartbeat/pacemaker<br />><br /><br />Have a look at http://clusterlabs.org/wiki/RHEL as to how to add repos<br />for EL6. Unfortunately, afaics, only Pacemaker is available as a newer<br />version, 1.1.5, corosync is still at 1.2.3.<br /><br />I'd also recommend building corosync RPM's from the tarball<br />(http://www.corosync.org/) , but that's just my personal preference,<br />some prefer pre-built binaries.<br /><br />><br />><br />> About what you said: Is there a limited number of resources that can run on<br />> one node, before pacemaker decides it is going to run a subsequent resource<br />> on another node ?<br /><br />The algorithm is basically round robin. By default it doesn't make any<br />assumptions about the "importance" of the resources, first resource<br />goes to first node, second to second node, third to first node, fourth<br />to second node, a.s.o., it's round robin, like I said.<br /><br />><br />> Wouldn't it be best to always use the colocation and order directives to<br />> prevent this from happening ?<br />><br /><br />It all depends on the purpose of the cluster, if it fits the need for<br />your setup, than yes, use colocation and ordering. There really isn't<br />a "one size fits all" scenario.<br /><br />Regards,<br />Dan<br /><br />><br />><br />> Thanks again,<br />><br />><br />><br />> Hans<br />><br />><br />> -----Original message-----<br />> To: The Pacemaker cluster resource manager <pacemaker@oss.clusterlabs.org>;<br />> From: Dan Frincu <df.cluster@gmail.com><br />> Sent: Wed 21-09-2011 12:44<br />> Subject: Re: [Pacemaker] Resource starts on wrong node ?<br />> Hi,<br />><br />> On Wed, Sep 21, 2011 at 1:02 PM, Hans Lammerts <j.lammerts@chello.nl> wrote:<br />>> Hi all,<br />>><br />>><br />>><br />>> Just started to configure a two node cluster (Centos 6) with drbd<br />>> 8.4.0-31.el6,<br />>><br />>> corosync 1.2.3 and pacemaker 1.1.2.<br />><br />> Strange choice of versions, if it's a new setup, why don't you go for<br />> corosync 1.4.1 and pacemaker 1.1.5?<br />><br />>><br />>> I created three DRBD filesystems, and started to add them in the crm<br />>> config<br />>> one by one.<br />>><br />>> Everything went OK. After adding these resources they start on node1, and<br />>> when I set node1<br />>><br />>> in standby, these three DRBD resources failover nicely to the second node.<br />>> And vice versa.<br />>><br />>> So far so good.<br />>><br />>><br />>><br />>> Next, I added one extra resource, that is supposed to put an IP alias on<br />>> eth0.<br />>><br />>> This also works, but strangely enough the alias is set on eth0 of the<br />>> second<br />>> node, where I would have<br />>><br />>> expected it to start on the first node (just as the three drbd resources<br />>> did).<br />>><br />>> Why the.... does Pacemaker decide that this resource is to be started on<br />>> the<br />>> second node ? I cannot grasp<br />>><br />>> the reason why.<br />><br />> Because it tries to load balance resources on available nodes. You<br />> have several resources running on one node, and didn't specify any<br />> restrictions on the mysqlip, therefore it chose the second node as it<br />> had less resources on it. You override the behavior with constraints.<br />> See below.<br />><br />>><br />>> Hope anyone can tell me what I'm doing wrong.<br />>><br />>><br />>><br />>> Thanks,<br />>><br />>> Hans<br />>><br />>><br />>><br />>> Just to be sure, I'll show my config below:<br />>><br />>><br />>><br />>> node cl1 \<br />>><br />>>         attributes standby="off"<br />>><br />>> node cl2 \<br />>><br />>>         attributes standby="off"<br />>><br />>> primitive drbd0 ocf:linbit:drbd \<br />>><br />>>         params drbd_resource="mysql" drbdconf="/etc/drbd.conf" \<br />>><br />>>         op start interval="0" timeout="240s" \<br />>><br />>>         op monitor interval="20s" timeout="20s" \<br />>><br />>>         op stop interval="0" timeout="100s"<br />>><br />>> primitive drbd1 ocf:linbit:drbd \<br />>><br />>>         params drbd_resource="www" drbdconf="/etc/drbd.conf" \<br />>><br />>>         op start interval="0" timeout="240s" \<br />>><br />>>         op monitor interval="20s" timeout="20s" \<br />>><br />>>         op stop interval="0" timeout="100s"<br />>><br />>> primitive drbd2 ocf:linbit:drbd \<br />>><br />>>         params drbd_resource="zarafa" drbdconf="/etc/drbd.conf" \<br />>><br />>>         op start interval="0" timeout="240s" \<br />>><br />>>         op monitor interval="20s" timeout="20s" \<br />>><br />>>         op stop interval="0" timeout="100s"<br />>><br />>> primitive mysqlfs ocf:heartbeat:Filesystem \<br />>><br />>>         params device="/dev/drbd0" fstype="ext4"<br />>> directory="/var/lib/mysql"<br />>> \<br />>><br />>>         op start interval="0" timeout="60s" \<br />>><br />>>         op monitor interval="20s" timeout="40s" \<br />>><br />>>         op stop interval="0" timeout="60s" \<br />>><br />>>         meta target-role="Started"<br />>><br />>> primitive mysqlip ocf:heartbeat:IPaddr2 \<br />>><br />>>         params ip="192.168.2.30" nic="eth0" cidr_netmask="24" \<br />>><br />>>         op start interval="0s" timeout="60s" \<br />>><br />>>         op monitor interval="5s" timeout="20s" \<br />>><br />>>         op stop interval="0s" timeout="60s" \<br />>><br />>>         meta target-role="Started"<br />>><br />>> primitive wwwfs ocf:heartbeat:Filesystem \<br />>><br />>>         params device="/dev/drbd1" fstype="ext4" directory="/var/www" \<br />>><br />>>         op start interval="0" timeout="60s" \<br />>><br />>>         op monitor interval="20s" timeout="40s" \<br />>><br />>>         op stop interval="0" timeout="60s"<br />>><br />>> primitive zarafafs ocf:heartbeat:Filesystem \<br />>><br />>>         params device="/dev/drbd2" fstype="ext4"<br />>> directory="/var/lib/zarafa"<br />>> \<br />>><br />>>         op start interval="0" timeout="60s" \<br />>><br />>>         op monitor interval="20s" timeout="40s" \<br />>><br />>>         op stop interval="0" timeout="60s"<br />>><br />>> ms ms_drbd0 drbd0 \<br />>><br />>>         meta master-max="1" master-node-max="1" clone-max="2"<br />>> clone-node-max="1" notify="true" target-role="Started"<br />>><br />>> ms ms_drbd1 drbd1 \<br />>><br />>>         meta master-max="1" master-node-max="1" clone-max="2"<br />>> clone-node-max="1" notify="true"<br />>><br />>> ms ms_drbd2 drbd2 \<br />>><br />>>         meta master-max="1" master-node-max="1" clone-max="2"<br />>> clone-node-max="1" notify="true"<br />>><br />>> colocation fs2_on_drbd inf: wwwfs ms_drbd1:Master<br />>><br />>> colocation fs3_on_drbd inf: zarafafs ms_drbd2:Master<br />>><br />>> colocation fs_on_drbd inf: mysqlfs ms_drbd0:Master<br />>><br />>> order fs2_after_drbd inf: ms_drbd1:promote wwwfs:start<br />>><br />>> order fs3_after_drbd inf: ms_drbd2:promote zarafafs:start<br />>><br />>> order fs_after_drbd inf: ms_drbd0:promote mysqlfs:start<br />>><br />><br />> You either set a location constraint for mysqlip or use a colocation<br />> and ordering constraint for it.<br />><br />> e.g.: colocation mysqlip_on_drbd inf: mysqlip ms_drbd0:Master<br />> order mysqlip_after_drbd inf: ms_drbd0:promote mysqlip:start<br />><br />>> property $id="cib-bootstrap-options" \<br />>><br />>>         dc-version="1.1.2-f059ec7ced7a86f18e5490b67ebf4a0b963bccfe" \<br />>><br />>>         cluster-infrastructure="openais" \<br />>><br />>>         expected-quorum-votes="2" \<br />>><br />>>         no-quorum-policy="ignore" \<br />>><br />>>         stonith-enabled="false"<br />>><br />>> rsc_defaults $id="rsc-options" \<br />>><br />>>         resource_stickyness="INFINITY" \<br />><br />> I wouldn't set INFINITY, it will cause problems, I'd give it a value<br />> of 500 or 1000.<br />><br />> Regards,<br />> Dan<br />><br />>><br />>>         migration-threshold="1"<br />>><br />>> _______________________________________________<br />>> Pacemaker mailing list: Pacemaker@oss.clusterlabs.org<br />>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker<br />>><br />>> Project Home: http://www.clusterlabs.org<br />>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br />>> Bugs:<br />>> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker<br />>><br />>><br />><br />><br />><br />> --<br />> Dan Frincu<br />> CCNA, RHCE<br />><br />> _______________________________________________<br />> Pacemaker mailing list: Pacemaker@oss.clusterlabs.org<br />> http://oss.clusterlabs.org/mailman/listinfo/pacemaker<br />><br />> Project Home: http://www.clusterlabs.org<br />> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br />> Bugs:<br />> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker<br />><br />> _______________________________________________<br />> Pacemaker mailing list: Pacemaker@oss.clusterlabs.org<br />> http://oss.clusterlabs.org/mailman/listinfo/pacemaker<br />><br />> Project Home: http://www.clusterlabs.org<br />> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br />> Bugs:<br />> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker<br />><br />><br /><br /><br /><br />-- <br />Dan Frincu<br />CCNA, RHCE<br /><br />_______________________________________________<br />Pacemaker mailing list: Pacemaker@oss.clusterlabs.org<br />http://oss.clusterlabs.org/mailman/listinfo/pacemaker<br /><br />Project Home: http://www.clusterlabs.org<br />Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br />Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker<br /></blockquote>
</body>
</html>