<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="mysql-cluster-install-shutdown-restart">
      </a>
      25.3.6 Safe Shutdown and Restart of NDB Cluster
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045122103680">
  </a>
  <a class="indexterm" name="idm46045122102192">
  </a>
  <p>
   To shut down the cluster, enter the following command in a shell
      on the machine hosting the management node:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa33870798"><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-terminal"><span class="token prompt">$&gt; </span><span class="token command">ndb_mgm</span> <span class="token property">-e</span> shutdown</code></pre>
  </div>
  <p>
   The
   <code class="option">
    -e
   </code>
   option here is used to pass a command to
      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 from the shell. The command
      causes 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>
   ,
   <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>
   , and any
   <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>
   processes to terminate gracefully. Any
      SQL nodes can be terminated using
   <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
    <span class="command">
     <strong>
      mysqladmin
      shutdown
     </strong>
    </span>
   </a>
   and other means. On Windows platforms, assuming
      that you have installed the SQL node as a Windows service, you can
      use
   <span class="command">
    <strong>
     SC STOP
     <em class="replaceable">
      <code>
       service_name
      </code>
     </em>
    </strong>
   </span>
   or
   <span class="command">
    <strong>
     NET
      STOP
     <em class="replaceable">
      <code>
       service_name
      </code>
     </em>
    </strong>
   </span>
   .
  </p>
  <p>
   To restart the cluster on Unix platforms, run these commands:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      On the management host (
      <code class="literal">
       198.51.100.10
      </code>
      in
          our example setup):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa96530647"><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-terminal"><span class="token prompt">$&gt; </span><span class="token command">ndb_mgmd</span> <span class="token property">-f</span> /var/lib/mysql-cluster/config<span class="token punctuation">.</span>ini</code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      On each of the data node hosts
          (
      <code class="literal">
       198.51.100.30
      </code>
      and
      <code class="literal">
       198.51.100.40
      </code>
      ):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa91954605"><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-terminal"><span class="token prompt">$&gt; </span><span class="token command">ndbd</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Use 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 to verify that both
          data nodes have started successfully.
     </p>
    </li>
    <li class="listitem">
     <p>
      On the SQL host (
      <code class="literal">
       198.51.100.20
      </code>
      ):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa55249853"><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-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqld_safe</span> &amp;</code></pre>
     </div>
    </li>
   </ul>
  </div>
  <p>
   On Windows platforms, assuming that you have installed all NDB
      Cluster processes as Windows services using the default service
      names (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>
   ), you can
      restart the cluster as follows:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      On the management host (
      <code class="literal">
       198.51.100.10
      </code>
      in
          our example setup), execute the following command:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa99199041"><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-terminal"><span class="token prompt">C:\&gt;</span><span class="token command"> SC</span> START ndb_mgmd</code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      On each of the data node hosts
          (
      <code class="literal">
       198.51.100.30
      </code>
      and
      <code class="literal">
       198.51.100.40
      </code>
      ), execute the following
          command:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa4444343"><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-terminal"><span class="token prompt">C:\&gt;</span><span class="token command"> SC</span> START ndbd</code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      On the management node host, use 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 to verify that the
          management node and both data nodes have started successfully
          (see
      <a class="xref" href="mysql-cluster-install-windows-initial-start.html" title="25.3.2.3 Initial Startup of NDB Cluster on Windows">
       Section 25.3.2.3, “Initial Startup of NDB Cluster on Windows”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      On the SQL node host (
      <code class="literal">
       198.51.100.20
      </code>
      ),
          execute the following command:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa13053"><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-terminal"><span class="token prompt">C:\&gt;</span><span class="token command"> SC</span> START mysql</code></pre>
     </div>
    </li>
   </ul>
  </div>
  <p>
   In a production setting, it is usually not desirable to shut down
      the cluster completely. In many cases, even when making
      configuration changes, or performing upgrades to the cluster
      hardware or software (or both), which require shutting down
      individual host machines, it is possible to do so without shutting
      down the cluster as a whole by performing a
   <span class="firstterm">
    rolling restart
   </span>
   of the
      cluster. For more information about doing this, see
   <a class="xref" href="mysql-cluster-rolling-restart.html" title="25.6.5 Performing a Rolling Restart of an NDB Cluster">
    Section 25.6.5, “Performing a Rolling Restart of an NDB Cluster”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
