![]() |
|||
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
| |||||||||||||||
Identifying the Properties of a NodeThe eligibility of a node to become master is determined by properties such as its master-eligibility, qualification level, and synchronization state. The qualification level of a node, relevant only for master-eligible nodes, determines if the node can participate in a master or vice-master election. For information about qualification levels that a node can have, see Qualification Levels. The following functions retrieve information about the eligibility and qualification level of a node: If a node is disqualified, it cannot become master or vice-master until it is requalified. Further information can be found in the relevant man pages, such as cmm_member_iseligible(3CMM). For an example that demonstrates how to requalify a node, see Example 7-4. The function cmm_member_isdesynchronized() tests if the master and vice-master nodes are synchronized. If the master and vice-master nodes are not synchronized, the vice-master node cannot become the master if the master fails. Similarly, at cluster startup, a desynchronized node cannot be elected master even if it is master-eligible and qualified. For more information about synchronization, see the definition of CMM_FLAG_SYNCHRO_NEEDED in Administrative Attributes. For more information about the cmm_member_isdesynchronized() function, see the cmm_member_isdesynchronized(3CMM) man page. The cmm_member_getinfo() function returns information for any peer node that is master, vice-master, or in the cluster. The cmm_potential_getinfo() function returns information for all peer nodes, even if the node has the CMM_OUT_OF_CLUSTER role and might not yet have entered the cluster. The cmm_member_getinfo() and cmm_potential_getinfo() functions retrieve information about a node identified by nodeid. To find the nodeid, see Example 5-1. Both functions retrieve this information from the cmm_member_t structure. For information about these functions, see the cmm_member_getinfo(3CMM) and cmm_potential_getinfo(3CMM) man pages. Example 5-7 demonstrates how to obtain information about the eligibility of the current node to become master. This example uses the following functions:
Example 5-7 Determining Whether a Node Can Become Master
Using the cmm_member_t Structure for Information About Member NodesThe cmm_member_t structure, contained within the CMM API, is an important source of information about member nodes. This structure contains the following fields:
| |||||||||||||||
| |||||||||||||||
![]() |