[ClusterLabs] Beginner lost with promotable "group" design

Ken Gaillot kgaillot at redhat.com
Wed Jan 17 10:33:53 EST 2024

On Wed, 2024-01-17 at 14:23 +0100, Adam Cécile wrote:
> Hello,
> I'm trying to achieve the following setup with 3 hosts:
> * One master gets a shared IP, then remove default gw, add another
> gw, 
> start a service
> * Two slaves should have none of them but add a different default gw
> I managed quite easily to get the master workflow running with
> ordering 
> constraints but I don't understand how I should move forward with
> the 
> slave configuration.
> I think I must create a promotable resource first then assign my
> other 
> resources with started/stopped  setting depending on the promote
> status 
> of the node. Is that correct ? How to create a promotable
> "placeholder" 
> where I can later attach my existing resources ?

A promotable resource would be appropriate if the service should run on
all nodes, but one node runs with a special setting. That doesn't sound
like what you have.

If you just need the service to run on one node, the shared IP,
service, and both gateways can be regular resources. You just need
colocation constraints between them:

- colocate service and external default route with shared IP
- clone the internal default route and anti-colocate it with shared IP

If you want the service to be able to run even if the IP can't, make
its colocation score finite (or colocate the IP and external route with
the service).

Ordering is separate. You can order the shared IP, service, and
external route however needed. Alternatively, you can put the three of
them in a group (which does both colocation and ordering, in sequence),
and anti-colocate the cloned internal route with the group.

> Sorry for the stupid question but I really don't understand what type
> of 
> elements I should create...
> Thanks in advance,
> Regards, Adam.
> PS: Bonus question should I use "pcs" or "crm" ? It seems both
> command 
> seem to be equivalent and documentations use sometime one or another

They are equivalent -- it's a matter of personal preference (and often
what choices your distro give you).
Ken Gaillot <kgaillot at redhat.com>

More information about the Users mailing list