[ClusterLabs] How to block/stop a resource from running twice?

Ken Gaillot kgaillot at redhat.com
Wed Apr 26 13:56:05 EDT 2023


On Wed, 2023-04-26 at 17:05 +0000, fs3000 via Users wrote:
> ------- Original Message -------
> On Monday, April 24th, 2023 at 10:08, Andrei Borzenkov <
> arvidjaar at gmail.com> wrote:
> 
> 
> > On Mon, Apr 24, 2023 at 11:52 AM Klaus Wenninger 
> > kwenning at redhat.com wrote:
> > 
> > > The checking for a running resource that isn't expected to be
> > > running isn't done periodically (at
> > > least not per default and I don't know a way to achieve that from
> > > the top of my mind).
> > 
> > op monitor role=Stopped interval=20s
> 
> Thanks a lot for the tip. It works, Not perfect, but that's fine.
> When it detects the service is also active on a second node, it stops
> the service on all nodes, and restarts the service on the first node.
> Would be better if only it stopped the service on the second none,
> leaving the service on the first node untouched. I understand this is
> due to the multiple-active setting however:
> 
> 
> What should the cluster do if it ever finds the resource active on
> more than one node? Allowed values: 
> 
> - block: mark the resource as unmanaged
> - stop_only: stop all active instances and leave them that way
> - stop_start: stop all active instances and start the resource in one
> location only
> 
> DEFAULT: stop_start
> 
> 
> From: 
> https://clusterlabs.org/pacemaker/doc/deprecated/en-US/Pacemaker/1.1/html/Pacemaker_Explained/s-resource-options.html

Since Pacemaker 2.1.4, multiple-active can be set to "stop_unexpected"
to do what you want.

It's not the default because some services may no longer operate
correctly if an extra instance was started on the same host, so it's on
the admin to be confident their services can handle it.
-- 
Ken Gaillot <kgaillot at redhat.com>



More information about the Users mailing list