<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="mysql-cluster-rolling-restart">
      </a>
      25.6.5 Performing a Rolling Restart of an NDB Cluster
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045092605824">
  </a>
  <a class="indexterm" name="idm46045092604336">
  </a>
  <a class="indexterm" name="idm46045092603232">
  </a>
  <a class="indexterm" name="idm46045092601744">
  </a>
  <a class="indexterm" name="idm46045092600256">
  </a>
  <p>
   This section discusses how to perform a
   <span class="firstterm">
    rolling restart
   </span>
   of an NDB
      Cluster installation, so called because it involves stopping and
      starting (or restarting) each node in turn, so that the cluster
      itself remains operational. This is often done as part of a
   <span class="firstterm">
    rolling upgrade
   </span>
   or
   <span class="firstterm">
    rolling downgrade
   </span>
   , where
      high availability of the cluster is mandatory and no downtime of
      the cluster as a whole is permissible. Where we refer to upgrades,
      the information provided here also generally applies to downgrades
      as well.
  </p>
  <p>
   There are a number of reasons why a rolling restart might be
      desirable. These are described in the next few paragraphs.
  </p>
  <p>
   <b>
    Configuration change.
   </b>
   <a class="indexterm" name="idm46045092594960">
   </a>
   To make a change in the cluster's configuration, such as
        adding an SQL node to the cluster, or setting a configuration
        parameter to a new value.
  </p>
  <p>
   <b>
    NDB Cluster software upgrade or downgrade.
   </b>
   To upgrade the cluster to a newer version of the NDB Cluster
        software (or to downgrade it to an older version). This is
        usually referred to as a
   <span class="quote">
    “
    <span class="quote">
     rolling upgrade
    </span>
    ”
   </span>
   (or
   <span class="quote">
    “
    <span class="quote">
     rolling downgrade
    </span>
    ”
   </span>
   , when reverting to an older
        version of NDB Cluster).
  </p>
  <p>
   <b>
    Change on node host.
   </b>
   To make changes in the hardware or operating system on which one
        or more NDB Cluster node processes are running.
  </p>
  <p>
   <b>
    System reset (cluster reset).
   </b>
   <a class="indexterm" name="idm46045092588384">
   </a>
   To reset the cluster because it has reached an undesirable
        state. In such cases it is often desirable to reload the data
        and metadata of one or more data nodes. This can be done in any
        of three ways:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Start each data node process (
      <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>
      or
          possibly
      <a class="link" href="mysql-cluster-programs-ndbmtd.html" title="25.5.3 ndbmtd — The NDB Cluster Data Node Daemon (Multi-Threaded)">
       <span class="command">
        <strong>
         ndbmtd
        </strong>
       </span>
      </a>
      ) with the
      <a class="link" href="mysql-cluster-programs-ndbd.html#option_ndbd_initial">
       <code class="option">
        --initial
       </code>
      </a>
      option, which forces
          the data node to clear its file system and to reload all NDB
          Cluster data and metadata from the other data nodes. This also
          forces the removal of all Disk Data objects and files
          associated with those objects.
     </p>
    </li>
    <li class="listitem">
     <p>
      Create a backup using the
      <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
        </strong>
       </span>
      </a>
      client
      <a class="link" href="mysql-cluster-backup-using-management-client.html" title="25.6.8.2 Using The NDB Cluster Management Client to Create a Backup">
       <code class="literal">
        START BACKUP
       </code>
      </a>
      command prior
          to performing the restart. Following the upgrade, restore the
          node or nodes using
      <a class="link" href="mysql-cluster-programs-ndb-restore.html" title="25.5.23 ndb_restore — Restore an NDB Cluster Backup">
       <span class="command">
        <strong>
         ndb_restore
        </strong>
       </span>
      </a>
      .
     </p>
     <p>
      See
      <a class="xref" href="mysql-cluster-backup.html" title="25.6.8 Online Backup of NDB Cluster">
       Section 25.6.8, “Online Backup of NDB Cluster”
      </a>
      , and
      <a class="xref" href="mysql-cluster-programs-ndb-restore.html" title="25.5.23 ndb_restore — Restore an NDB Cluster Backup">
       Section 25.5.23, “ndb_restore — Restore an NDB Cluster Backup”
      </a>
      , for more
          information.
     </p>
    </li>
    <li class="listitem">
     <p>
      Use
      <a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
       <span class="command">
        <strong>
         mysqldump
        </strong>
       </span>
      </a>
      to create a backup prior to
          the upgrade; afterward, restore the dump using
      <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
       <code class="literal">
        LOAD DATA
       </code>
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   <b>
    Resource Recovery.
   </b>
   <a class="indexterm" name="idm46045092570592">
   </a>
   To free memory previously allocated to a table by successive
   <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
    <code class="literal">
     INSERT
    </code>
   </a>
   and
   <a class="link" href="delete.html" title="15.2.2 DELETE Statement">
    <code class="literal">
     DELETE
    </code>
   </a>
   operations, for re-use by
        other NDB Cluster tables.
  </p>
  <p>
   The process for performing a rolling restart may be generalized as
      follows:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Stop all cluster management nodes (
      <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>
      processes), reconfigure them, then restart them. (See
      <a class="xref" href="mysql-cluster-rolling-restart.html#mysql-cluster-rolling-restart-multiple-ndb-mgmd" title="Rolling restarts with multiple management servers">
       Rolling restarts with multiple management servers
      </a>
      .)
     </p>
    </li>
    <li class="listitem">
     <p>
      Stop, reconfigure, then restart each cluster 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) in turn.
     </p>
     <p>
      Some node configuration parameters can be updated by issuing
      <a class="link" href="mysql-cluster-mgm-client-commands.html#ndbclient-restart">
       <code class="literal">
        RESTART
       </code>
      </a>
      for each of the
          data nodes in the
      <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
        </strong>
       </span>
      </a>
      client following
          the previous step. Other parameters require that the data node
          be stopped completely using the management client
      <a class="link" href="mysql-cluster-mgm-client-commands.html#ndbclient-stop">
       <code class="literal">
        STOP
       </code>
      </a>
      command, then started
          again from a system shell by invoking the
      <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>
      or
      <a class="link" href="mysql-cluster-programs-ndbmtd.html" title="25.5.3 ndbmtd — The NDB Cluster Data Node Daemon (Multi-Threaded)">
       <span class="command">
        <strong>
         ndbmtd
        </strong>
       </span>
      </a>
      executable as appropriate. (A shell command such as
      <a class="link" href="kill.html" title="15.7.8.4 KILL Statement">
       <span class="command">
        <strong>
         kill
        </strong>
       </span>
      </a>
      can also be used on most
          Unix systems to stop a data node process, but the
      <code class="literal">
       STOP
      </code>
      command is preferred and usually
          simpler.)
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       On Windows, you can also use
       <span class="command">
        <strong>
         SC STOP
        </strong>
       </span>
       and
       <span class="command">
        <strong>
         SC START
        </strong>
       </span>
       commands,
       <code class="literal">
        NET
            STOP
       </code>
       and
       <code class="literal">
        NET START
       </code>
       commands, or
            the Windows Service Manager to stop and start nodes which
            have been installed as Windows services (see
       <a class="xref" href="mysql-cluster-install-windows-service.html" title="25.3.2.4 Installing NDB Cluster Processes as Windows Services">
        Section 25.3.2.4, “Installing NDB Cluster Processes as Windows Services”
       </a>
       ).
      </p>
     </div>
     <p>
      The type of restart required is indicated in the documentation
          for each node configuration parameter. See
      <a class="xref" href="mysql-cluster-config-file.html" title="25.4.3 NDB Cluster Configuration Files">
       Section 25.4.3, “NDB Cluster Configuration Files”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Stop, reconfigure, then restart each cluster SQL node
          (
      <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
       <span class="command">
        <strong>
         mysqld
        </strong>
       </span>
      </a>
      process) in turn.
     </p>
    </li>
   </ol>
  </div>
  <a class="indexterm" name="idm46045092542352">
  </a>
  <p>
   NDB Cluster supports a somewhat flexible order for upgrading
      nodes. When upgrading an NDB Cluster, you may upgrade API nodes
      (including SQL nodes) before upgrading the management nodes, data
      nodes, or both. In other words, you are permitted to upgrade the
      API and SQL nodes in any order. This is subject to the following
      provisions:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      This functionality is intended for use as part of an online
          upgrade only. A mix of node binaries from different NDB
          Cluster releases is neither intended nor supported for
          continuous, long-term use in a production setting.
     </p>
    </li>
    <li class="listitem">
     <p>
      You must upgrade all nodes of the same type (management, data,
          or API node) before upgrading any nodes of a different type.
          This remains true regardless of the order in which the nodes
          are upgraded.
     </p>
    </li>
    <li class="listitem">
     <p>
      You must upgrade all management nodes before upgrading any
          data nodes. This remains true regardless of the order in which
          you upgrade the cluster's API and SQL nodes.
     </p>
    </li>
    <li class="listitem">
     <p>
      Features specific to the
      <span class="quote">
       “
       <span class="quote">
        new
       </span>
       ”
      </span>
      version must not
          be used until all management nodes and data nodes have been
          upgraded.
     </p>
     <p>
      This also applies to any MySQL Server version change that may
          apply, in addition to the NDB engine version change, so do not
          forget to take this into account when planning the upgrade.
          (This is true for online upgrades of NDB Cluster in general.)
     </p>
    </li>
   </ul>
  </div>
  <p>
   It is not possible for any API node to perform schema operations
      (such as data definition statements) during a node restart. Due in
      part to this limitation, schema operations are also not supported
      during an online upgrade or downgrade. In addition, it is not
      possible to perform native backups while an upgrade or downgrade
      is ongoing.
  </p>
  <p>
   <a name="mysql-cluster-rolling-restart-multiple-ndb-mgmd">
   </a>
   <b>
    Rolling restarts with multiple management servers.
   </b>
   <a class="indexterm" name="idm46045092532384">
   </a>
   <a class="indexterm" name="idm46045092530864">
   </a>
   When performing a rolling restart of an NDB Cluster with
        multiple management nodes, you should keep in mind that
   <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>
   checks to see if any other
        management node is running, and, if so, tries to use that
        node's configuration data. To keep this from occurring, and
        to force
   <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>
   to re-read its
        configuration file, perform the following steps:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Stop all NDB Cluster
      <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>
      processes.
     </p>
    </li>
    <li class="listitem">
     <p>
      Update all
      <code class="filename">
       config.ini
      </code>
      files.
     </p>
    </li>
    <li class="listitem">
     <p>
      Start a single
      <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>
      with
      <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_reload">
       <code class="option">
        --reload
       </code>
      </a>
      ,
      <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_initial">
       <code class="option">
        --initial
       </code>
      </a>
      , or both options as
          desired.
     </p>
    </li>
    <li class="listitem">
     <p>
      If you started the first
      <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>
      with the
      <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_initial">
       <code class="option">
        --initial
       </code>
      </a>
      option, you must
          also start any remaining
      <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>
      processes
          using
      <code class="option">
       --initial
      </code>
      .
     </p>
     <p>
      Regardless of any other options used when starting the first
      <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>
      , you should not start any
          remaining
      <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>
      processes after the
          first one using
      <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_reload">
       <code class="option">
        --reload
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Complete the rolling restarts of the data nodes and API nodes
          as normal.
     </p>
    </li>
   </ol>
  </div>
  <p>
   When performing a rolling restart to update the cluster's
      configuration, you can use the
   <code class="literal">
    config_generation
   </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 to keep
      track of which data nodes have been successfully restarted with
      the new configuration. See
   <a class="xref" href="mysql-cluster-ndbinfo-nodes.html" title="25.6.17.48 The ndbinfo nodes Table">
    Section 25.6.17.48, “The ndbinfo nodes Table”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
