<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-ndbinfo-membership">
      </a>
      25.6.17.45 The ndbinfo membership Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045088954768">
  </a>
  <p>
   The
   <code class="literal">
    membership
   </code>
   table describes the view that
        each data node has of all the others in the cluster, including
        node group membership, president node, arbitrator, arbitrator
        successor, arbitrator connection states, and other information.
  </p>
  <p>
   The
   <code class="literal">
    membership
   </code>
   table contains the following
        columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       node_id
      </code>
     </p>
     <p>
      This node's node ID
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       group_id
      </code>
     </p>
     <p>
      Node group to which this node belongs
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       left node
      </code>
     </p>
     <p>
      Node ID of the previous node
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       right_node
      </code>
     </p>
     <p>
      Node ID of the next node
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       president
      </code>
     </p>
     <p>
      President's node ID
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       successor
      </code>
     </p>
     <p>
      Node ID of successor to president
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       succession_order
      </code>
     </p>
     <p>
      Order in which this node succeeds to presidency
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       Conf_HB_order
      </code>
     </p>
     <p>
      -
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       arbitrator
      </code>
     </p>
     <p>
      Node ID of arbitrator
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       arb_ticket
      </code>
     </p>
     <p>
      Internal identifier used to track arbitration
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       arb_state
      </code>
     </p>
     <p>
      Arbitration state
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       arb_connected
      </code>
     </p>
     <p>
      Whether this node is connected to the arbitrator; either of
      <code class="literal">
       Yes
      </code>
      or
      <code class="literal">
       No
      </code>
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       connected_rank1_arbs
      </code>
     </p>
     <p>
      Connected arbitrators of rank 1
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       connected_rank2_arbs
      </code>
     </p>
     <p>
      Connected arbitrators of rank 1
     </p>
    </li>
   </ul>
  </div>
  <h5>
   <a name="idm46045088922272">
   </a>
   Notes
  </h5>
  <p>
   The node ID and node group ID are the same as reported by
   <a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client">
    <span class="command">
     <strong>
      ndb_mgm -e "SHOW"
     </strong>
    </span>
   </a>
   .
  </p>
  <p>
   <code class="literal">
    left_node
   </code>
   and
   <code class="literal">
    right_node
   </code>
   are defined in terms of a model that connects all data nodes in
        a circle, in order of their node IDs, similar to the ordering of
        the numbers on a clock dial, as shown here:
  </p>
  <div class="figure">
   <a name="fig-mysql-cluster-circular-left-right">
   </a>
   <p class="title">
    <b>
     Figure 25.6 Circular Arrangement of NDB Cluster Nodes
    </b>
   </p>
   <div class="figure-contents">
    <div class="mediaobject">
     <img alt="Content is described in the surrounding text." src="images/cluster-left-right.png" style="width: 100%; max-width: 300px;"/>
    </div>
   </div>
  </div>
  <br class="figure-break"/>
  <p>
   In this example, we have 8 data nodes, numbered 5, 6, 7, 8, 12,
        13, 14, and 15, ordered clockwise in a circle. We determine
   <span class="quote">
    “
    <span class="quote">
     left
    </span>
    ”
   </span>
   and
   <span class="quote">
    “
    <span class="quote">
     right
    </span>
    ”
   </span>
   from the interior
        of the circle. The node to the left of node 5 is node 15, and
        the node to the right of node 5 is node 6. You can see all these
        relationships by running the following query and observing the
        output:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa66936502"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> node_id<span class="token punctuation">,</span>left_node<span class="token punctuation">,</span>right_node
<span class="token prompt">    -&gt;</span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>membership<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> node_id <span class="token punctuation">|</span> left_node <span class="token punctuation">|</span> right_node <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>       5 <span class="token punctuation">|</span>        15 <span class="token punctuation">|</span>          6 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>       6 <span class="token punctuation">|</span>         5 <span class="token punctuation">|</span>          7 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>       7 <span class="token punctuation">|</span>         6 <span class="token punctuation">|</span>          8 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>       8 <span class="token punctuation">|</span>         7 <span class="token punctuation">|</span>         12 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>      12 <span class="token punctuation">|</span>         8 <span class="token punctuation">|</span>         13 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>      13 <span class="token punctuation">|</span>        12 <span class="token punctuation">|</span>         14 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>      14 <span class="token punctuation">|</span>        13 <span class="token punctuation">|</span>         15 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>      15 <span class="token punctuation">|</span>        14 <span class="token punctuation">|</span>          5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">8 rows in set (0.00 sec)</span></code></pre>
  </div>
  <p>
   The designations
   <span class="quote">
    “
    <span class="quote">
     left
    </span>
    ”
   </span>
   and
   <span class="quote">
    “
    <span class="quote">
     right
    </span>
    ”
   </span>
   are used in the event log in the same way.
  </p>
  <p>
   The
   <code class="literal">
    president
   </code>
   node is the node viewed by the
        current node as responsible for setting an arbitrator (see
   <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-start-phases.html" target="_top">
    NDB Cluster Start Phases
   </a>
   ). If the president
        fails or becomes disconnected, the current node expects the node
        whose ID is shown in the
   <code class="literal">
    successor
   </code>
   column to
        become the new president. The
   <code class="literal">
    succession_order
   </code>
   column shows the place in
        the succession queue that the current node views itself as
        having.
  </p>
  <p>
   In a normal NDB Cluster, all data nodes should see the same node
        as
   <code class="literal">
    president
   </code>
   , and the same node (other than
        the president) as its
   <code class="literal">
    successor
   </code>
   . In addition,
        the current president should see itself as
   <code class="literal">
    1
   </code>
   in the order of succession, the
   <code class="literal">
    successor
   </code>
   node should see itself as
   <code class="literal">
    2
   </code>
   , and so on.
  </p>
  <p>
   All nodes should show the same
   <code class="literal">
    arb_ticket
   </code>
   values as well as the same
   <code class="literal">
    arb_state
   </code>
   values.
        Possible
   <code class="literal">
    arb_state
   </code>
   values are
   <code class="literal">
    ARBIT_NULL
   </code>
   ,
   <code class="literal">
    ARBIT_INIT
   </code>
   ,
   <code class="literal">
    ARBIT_FIND
   </code>
   ,
   <code class="literal">
    ARBIT_PREP1
   </code>
   ,
   <code class="literal">
    ARBIT_PREP2
   </code>
   ,
   <code class="literal">
    ARBIT_START
   </code>
   ,
   <code class="literal">
    ARBIT_RUN
   </code>
   ,
   <code class="literal">
    ARBIT_CHOOSE
   </code>
   ,
   <code class="literal">
    ARBIT_CRASH
   </code>
   , and
   <code class="literal">
    UNKNOWN
   </code>
   .
  </p>
  <p>
   <code class="literal">
    arb_connected
   </code>
   shows whether this node is
        connected to the node shown as this node's
   <code class="literal">
    arbitrator
   </code>
   .
  </p>
  <p>
   The
   <code class="literal">
    connected_rank1_arbs
   </code>
   and
   <code class="literal">
    connected_rank2_arbs
   </code>
   columns each display a
        list of 0 or more arbitrators having an
   <a class="link" href="mysql-cluster-mgm-definition.html#ndbparam-mgmd-arbitrationrank">
    <code class="literal">
     ArbitrationRank
    </code>
   </a>
   equal to
        1, or to 2, respectively.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Both management nodes and API nodes are eligible to become
          arbitrators.
   </p>
  </div>
 </div>
 <br/>
</div>
