Difference between revisions of "High Availability (AMF) Questions"

(FAQ)
(FAQ)
Line 7: Line 7:
  
 
* '''What’s the best way for an application to determine the name/slot of the currently active controller in the cluster?'''
 
* '''What’s the best way for an application to determine the name/slot of the currently active controller in the cluster?'''
: The relevant API is "clCpmSlotGet".  Example code is as follows:
+
: The relevant API is "clCpmMasterAddressGet".  Example code (which also converts the node's address into its name) is as follows:
 
<pre>
 
<pre>
 
#include <clCpmExtApi.h>
 
#include <clCpmExtApi.h>

Revision as of 01:14, 14 June 2011

High Availability (AMF)

Overview

OpenClovis ASP provides a SA-Forum compliant High Availability solution (the AMF in SAF terminology). This component controls the starting/stopping of applications, application redundancy configuration, and role assignment.

FAQ

  • What’s the best way for an application to determine the name/slot of the currently active controller in the cluster?
The relevant API is "clCpmMasterAddressGet". Example code (which also converts the node's address into its name) is as follows:
#include <clCpmExtApi.h>
ClRcT masterNodeGet(void)
{
    ClIocNodeAddressT node = 0;
    ClRcT rc = clCpmMasterAddressGet(&node);
    if(node)
    {
        ClCpmSlotInfoT slotInfo = {.slotId = node } ;
        rc = clCpmSlotGet(CL_CPM_SLOT_ID, &slotInfo);
        if(rc == CL_OK)
            clLogNotice("MASTER", "GET", " Currently active controller node name is [%.*s]",
                        slotInfo.nodeName.length, slotInfo.nodeName.value);
    }
    return rc;
}