<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="mysql-cluster-start-phases">
      </a>
      25.6.4 Summary of NDB Cluster Start Phases
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045092681776">
  </a>
  <a class="indexterm" name="idm46045092680288">
  </a>
  <p>
   This section provides a simplified outline of the steps involved
      when NDB Cluster data nodes are started. More complete information
      can be found in
   <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-start-phases.html" target="_top">
    NDB Cluster Start Phases
   </a>
   , in
      the
   <em class="citetitle">
    <code class="literal">
     NDB
    </code>
    Internals Guide
   </em>
   .
  </p>
  <p>
   These phases are the same as those reported in the output from the
   <a class="link" href="mysql-cluster-mgm-client-commands.html#ndbclient-status">
    <code class="literal">
     <em class="replaceable">
      <code>
       node_id
      </code>
     </em>
     STATUS
    </code>
   </a>
   command in the management client (see
   <a class="xref" href="mysql-cluster-mgm-client-commands.html" title="25.6.1 Commands in the NDB Cluster Management Client">
    Section 25.6.1, “Commands in the NDB Cluster Management Client”
   </a>
   ). These start
      phases are also reported in the
   <code class="literal">
    start_phase
   </code>
   column of the
   <a class="link" href="mysql-cluster-ndbinfo-nodes.html" title="25.6.17.48 The ndbinfo nodes Table">
    <code class="literal">
     ndbinfo.nodes
    </code>
   </a>
   table.
  </p>
  <p>
   <b>
    Start types.
   </b>
   There are several different startup types and modes, as shown in
        the following list:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <b>
       Initial start.
      </b>
      The cluster starts with a clean file system on all data
            nodes. This occurs either when the cluster started for the
            very first time, or when all data nodes are restarted using
            the
      <a class="link" href="mysql-cluster-programs-ndbd.html#option_ndbd_initial">
       <code class="option">
        --initial
       </code>
      </a>
      option.
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       Disk Data files are not removed when restarting a node using
       <a class="link" href="mysql-cluster-programs-ndbd.html#option_ndbd_initial">
        <code class="option">
         --initial
        </code>
       </a>
       .
      </p>
     </div>
    </li>
    <li class="listitem">
     <p>
      <b>
       System restart.
      </b>
      The cluster starts and reads data stored in the data nodes.
            This occurs when the cluster has been shut down after having
            been in use, when it is desired for the cluster to resume
            operations from the point where it left off.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Node restart.
      </b>
      This is the online restart of a cluster node while the
            cluster itself is running.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Initial node restart.
      </b>
      This is the same as a node restart, except that the node is
            reinitialized and started with a clean file system.
     </p>
    </li>
   </ul>
  </div>
  <p>
   <b>
    Setup and initialization (phase -1).
   </b>
   Prior to startup, each data node (
   <a class="link" href="mysql-cluster-programs-ndbd.html" title="25.5.1 ndbd — The NDB Cluster Data Node Daemon">
    <span class="command">
     <strong>
      ndbd
     </strong>
    </span>
   </a>
   process) must be initialized. Initialization consists of the
        following steps:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Obtain a node ID
     </p>
    </li>
    <li class="listitem">
     <p>
      Fetch configuration data
     </p>
    </li>
    <li class="listitem">
     <p>
      Allocate ports to be used for inter-node communications
     </p>
    </li>
    <li class="listitem">
     <p>
      Allocate memory according to settings obtained from the
          configuration file
     </p>
    </li>
   </ol>
  </div>
  <p>
   When a data node or SQL node first connects to the management
      node, it reserves a cluster node ID. To make sure that no other
      node allocates the same node ID, this ID is retained until the
      node has managed to connect to the cluster and at least one
   <a class="link" href="mysql-cluster-programs-ndbd.html" title="25.5.1 ndbd — The NDB Cluster Data Node Daemon">
    <span class="command">
     <strong>
      ndbd
     </strong>
    </span>
   </a>
   reports that this node is connected. This
      retention of the node ID is guarded by the connection between the
      node in question and
   <a class="link" href="mysql-cluster-programs-ndb-mgmd.html" title="25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon">
    <span class="command">
     <strong>
      ndb_mgmd
     </strong>
    </span>
   </a>
   .
  </p>
  <p>
   After each data node has been initialized, the cluster startup
      process can proceed. The stages which the cluster goes through
      during this process are listed here:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <b>
       Phase 0.
      </b>
      The
      <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-ndbfs.html" target="_top">
       <code class="literal">
        NDBFS
       </code>
      </a>
      and
      <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-ndbcntr.html" target="_top">
       <code class="literal">
        NDBCNTR
       </code>
      </a>
      blocks start.
            Data node file systems are cleared on those data nodes that
            were started with
      <a class="link" href="mysql-cluster-programs-ndbd.html#option_ndbd_initial">
       <code class="option">
        --initial
       </code>
      </a>
      option.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 1.
      </b>
      In this stage, all remaining
      <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
       <code class="literal">
        NDB
       </code>
      </a>
      kernel blocks are started.
            NDB Cluster connections are set up, inter-block
            communications are established, and heartbeats are started.
            In the case of a node restart, API node connections are also
            checked.
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       When one or more nodes hang in Phase 1 while the remaining
            node or nodes hang in Phase 2, this often indicates network
            problems. One possible cause of such issues is one or more
            cluster hosts having multiple network interfaces. Another
            common source of problems causing this condition is the
            blocking of TCP/IP ports needed for communications between
            cluster nodes. In the latter case, this is often due to a
            misconfigured firewall.
      </p>
     </div>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 2.
      </b>
      The
      <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-ndbcntr.html" target="_top">
       <code class="literal">
        NDBCNTR
       </code>
      </a>
      kernel block
            checks the states of all existing nodes. The master node is
            chosen, and the cluster schema file is initialized.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 3.
      </b>
      The
      <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-dblqh.html" target="_top">
       <code class="literal">
        DBLQH
       </code>
      </a>
      and
      <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-dbtc.html" target="_top">
       <code class="literal">
        DBTC
       </code>
      </a>
      kernel blocks set
            up communications between them. The startup type is
            determined; if this is a restart, the
      <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-dbdih.html" target="_top">
       <code class="literal">
        DBDIH
       </code>
      </a>
      block obtains
            permission to perform the restart.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 4.
      </b>
      For an initial start or initial node restart, the redo log
            files are created. The number of these files is equal to
      <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-nooffragmentlogfiles">
       <code class="literal">
        NoOfFragmentLogFiles
       </code>
      </a>
      .
     </p>
     <p>
      For a system restart:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Read schema or schemas.
        </p>
       </li>
       <li class="listitem">
        <p>
         Read data from the local checkpoint.
        </p>
       </li>
       <li class="listitem">
        <p>
         Apply all redo information until the latest restorable
              global checkpoint has been reached.
        </p>
       </li>
      </ul>
     </div>
     <p>
      For a node restart, find the tail of the redo log.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 5.
      </b>
      Most of the database-related portion of a data node start is
            performed during this phase. For an initial start or system
            restart, a local checkpoint is executed, followed by a
            global checkpoint. Periodic checks of memory usage begin
            during this phase, and any required node takeovers are
            performed.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 6.
      </b>
      In this phase, node groups are defined and set up.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 7.
      </b>
      The arbitrator node is selected and begins to function. The
            next backup ID is set, as is the backup disk write speed.
            Nodes reaching this start phase are marked as
      <code class="literal">
       Started
      </code>
      . It is now possible for API nodes
            (including SQL nodes) to connect to the cluster.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 8.
      </b>
      If this is a system restart, all indexes are rebuilt (by
      <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-dbdih.html" target="_top">
       <code class="literal">
        DBDIH
       </code>
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 9.
      </b>
      The node internal startup variables are reset.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 100 (OBSOLETE).
      </b>
      Formerly, it was at this point during a node restart or
            initial node restart that API nodes could connect to the
            node and begin to receive events. Currently, this phase is
            empty.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       Phase 101.
      </b>
      At this point in a node restart or initial node restart,
            event delivery is handed over to the node joining the
            cluster. The newly-joined node takes over responsibility for
            delivering its primary data to subscribers. This phase is
            also referred to as
      <span class="firstterm">
       <a class="ulink" href="/doc/ndb-internals/en/ndb-internals-kernel-blocks-suma.html" target="_top">
        <code class="literal">
         SUMA
        </code>
       </a>
       handover phase
      </span>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   After this process is completed for an initial start or system
      restart, transaction handling is enabled. For a node restart or
      initial node restart, completion of the startup process means that
      the node may now act as a transaction coordinator.
  </p>
 </div>
 <br/>
</div>
