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