[ClusterLabs Developers] SDK/API's for Pacemaker/Corosync

Ken Gaillot kgaillot at redhat.com
Mon Feb 4 21:23:21 UTC 2019


On Mon, 2019-02-04 at 09:11 -0800, Vinod Chegu wrote:
> 
> Hi Ken
> 
> Thanks for your response and pointers !  
> 
> What you suggest is certainly one option.  
> 
> If there are any examples of using the C API's please point me to the
> same. 'am trying to search for them too.

Speaking only of the pacemaker C API, it's pretty low-level and
unlikely to have anything of interest. The (meager) documentation for
it is here:

http://clusterlabs.org/pacemaker/doxygen/

There aren't any examples per se, but you can look at the various
pacemaker command-line tools:

https://github.com/ClusterLabs/pacemaker/tree/master/tools


> 
> Thanks!
> Vinod  
> 
> On Mon, Feb 4, 2019 at 8:57 AM Ken Gaillot <kgaillot at redhat.com>
> wrote:
> > On Sun, 2019-02-03 at 08:44 -0800, Vinod Chegu wrote:
> > > Hello,
> > > 
> > > 'am new to this forum and am looking for some pointers. 
> > > 
> > > Are there any Python based examples (in some github repo etc)
> > that
> > > show the usage of Pacemaker/Corosync APIs for creation and
> > management
> > > (add/delete/list/[un]maintenance, monitor alerts) of cluster of
> > Linux
> > > nodes?
> > > 
> > > Thanks !
> > > VC
> > 
> > Hi Vinod,
> > 
> > There is currently no Python API, though that is on the long-term
> > wish
> > list.
> > 
> > Corosync and Pacemaker each have C APIs, but those are likely much
> > lower level than you're interested in. For cluster creation etc.,
> > the
> > command-line tools are the primary way to interact with the
> > cluster, so
> > using those with subprocess.call() would be one way to go.
> > 
> > The higher-level tools crm shell and pcs provide an easier
> > interface to
> > both corosync and pacemaker, so you may want to pick one of them
> > instead, at the cost of creating an additional dependency for your
> > tool.
> > 
> > For alerts, you can have pacemaker call a Python script with
> > interesting info passed as environment variables. See:
> > 
> > 
http://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/index.html#idm140330787858944
> > _______________________________________________
> > Developers mailing list
> > Developers at clusterlabs.org
> > https://lists.clusterlabs.org/mailman/listinfo/developers
-- 
Ken Gaillot <kgaillot at redhat.com>




More information about the Developers mailing list