[ClusterLabs] Creating a rule based on whether a quorum exists

Les Green les at greemo.com
Tue Jun 7 02:10:05 EDT 2016


Thanks, yeah, I think the quorum-only node is the go. Seems much more natural. Cheers!

On 06.06.2016 22:36, Ken Gaillot wrote:
> On 05/30/2016 08:13 AM, Les Green wrote:
> > Hi All,
> >
> > I have a two-node cluster with no-quorum-policy=ignore and an external
> > ping responder to try to determine if a node has its network down (it's
> > the dead one), or if the other node is really dead..
> >
> > The ping helps to determine who the master is.
> >
> > I have realised in the situation where the ping responder goes down,
> > both stop being the master.
> >
> > Code can be seen here: https://github.com/greemo/vagrant-fabric
> >
> > I currently have the following rule which prevents a node becoming a
> > master unless it can access the ping resource. (I may add more ping
> > resources later):
> >
> >     <constraints>
> >       <rsc_colocation id="c_mysql_on_drbd" score="INFINITY"
> > rsc="g_mysql" with-rsc="ms_drbd_mysql" with-rsc-role="Master"/>
> >       <rsc_location id="l_drbd_master_on_ping" rsc="ms_drbd_mysql">
> >         <rule role="Master" score="-INFINITY" boolean-op="or"
> > id="l_drbd_master_on_ping-rule">
> >           <expression attribute="ping" operation="not_defined"
> > id="l_drbd_master_on_ping-rule-expression"/>
> >           <expression attribute="ping" operation="lte" value="1000"
> > type="number" id="l_drbd_master_on_ping-rule-expression-0"/>
> >         </rule>
> >       </rsc_location>
> >       <rsc_order id="o_drbd_before_mysql" score="INFINITY"
> > first="ms_drbd_mysql" first-action="promote" then="g_mysql"
> > then-action="start"/>
> >     </constraints>
> >
> >
> > I want to create a rule that says "if I am not in a quorum AND I cannot
> > access all the ping resources, do not become the master". I can sort out
> > the ping part, but how can I determine within a Pacemaker rule if I am
> > part of a quorum?
> >
> > I have thought to set up a cron job using shell tools to query the CIB
> > and populate an attribute, but surely there has to be an easier way...
> >
> > Hopefully, Les
>
> Not that I'm aware of. Some alternatives: set up the ping responder as a
> quorum-only node instead; configure fencing and get rid of the ping
> resource; list the cluster nodes in the ping resource's host_list and
> change the rule to lte 1.
>
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://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
>





More information about the Users mailing list