[ClusterLabs] Custom resource agent

Reid Wahl nwahl at redhat.com
Fri Jul 17 21:06:05 EDT 2020


Based on my understanding of the question, your best options would be

   - Create a resource agent that's designed to be run as a promotable clone
   <http://10.2.2. Promotable clones> (the ocf:pacemaker:Stateful
   <https://github.com/ClusterLabs/pacemaker/blob/master/extra/resources/Stateful>
   resource agent is a simple example), OR
   - Create two separate resource agents and configure a resource for each.
   Then configure a colocation constraint
   <https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/index.html#s-resource-colocation>
   with a negative score, so that they cannot run on the same node
   simultaneously.


> Hi Oyvind,
> thank you for reply!
>
> Iinteresting, but not simple...
> I did some tests with ocf_heartbeat_anything and the simple start and stop
> seems to work correctly.
> Would it be possible to create two opposite "services" with this ocf?
>
> Example:
>
> NODE1 (Master)   service-master (START) & service-slave (STOP)
> NODE2 (Slave)     service-master (STOP) & service-slave (START)
>
> "Service-master" puts down "service-slave" and does the opposite in the
> second node.
>
> Regards
> Sim
>
> Il giorno mar 14 lug 2020 alle ore 10:41 Oyvind Albrigtsen <
> oalbrigt at redhat.com> ha scritto:
>
> > You should be able to make your custom agent by following this doc:
> >
> >
https://github.com/ClusterLabs/resource-agents/blob/master/doc/dev-guides/ra-dev-guide.asc
> >
> > Oyvind
> >
> > On 13/07/20 10:08 +0200, Sim wrote:
> > >Hi,
> > >I need to create a cluster with these characteristics:
> > >
> > >NODE1 (Master)
> > >NODE2 (Slave)
> > >
> > >Example sequence to moving the role from NODE1 to NODE2:
> > >
> > >- NODE1: stopped a process with "systemctl stop"
> > >- NODE1: executed a script with parameter "slave"
> > >- NODE1: executed again the process with "systemctl start"
> > >- NODE2: stopped a process with "systemctl stop"
> > >- NODE2: executed a script "master"
> > >- NODE2: executed again the process with "systemctl start"
> > >
> > >I only found ocf_heartbeat_anything but I don't know if it's right for
me.
> > >Any suggestions?
> > >
> > >Regards
> > >Sim
> >
> > >_______________________________________________
> > >Manage your subscription:
> > >https://lists.clusterlabs.org/mailman/listinfo/users
> > >
> > >ClusterLabs home: https://www.clusterlabs.org/
> >
> > _______________________________________________
> > Manage your subscription:
> > https://lists.clusterlabs.org/mailman/listinfo/users
> >
> > ClusterLabs home: https://www.clusterlabs.org/
> >

-- 
Regards,

Reid Wahl, RHCA
Software Maintenance Engineer, Red Hat
CEE - Platform Support Delivery - ClusterHA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clusterlabs.org/pipermail/users/attachments/20200717/2635e5dc/attachment.htm>


More information about the Users mailing list