<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="mysql-cluster-programs-ndbmtd">
      </a>
      25.5.3 ndbmtd — The NDB Cluster Data Node Daemon (Multi-Threaded)
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045107293824">
  </a>
  <a class="indexterm" name="idm46045107292880">
  </a>
  <a class="indexterm" name="idm46045107291520">
  </a>
  <a class="indexterm" name="idm46045107290160">
  </a>
  <a class="indexterm" name="idm46045107289248">
  </a>
  <p>
   <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>
   is a multithreaded version of
   <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>
   , the process that is used to handle all
        the data in tables using the
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDBCLUSTER
    </code>
   </a>
   storage engine.
   <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>
   is intended for use on host computers
        having multiple CPU cores. Except where otherwise noted,
   <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>
   functions in the same way as
   <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>
   ; therefore, in this section, we
        concentrate on the ways in which
   <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>
   differs from
   <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>
   , and you should consult
   <a class="xref" href="mysql-cluster-programs-ndbd.html" title="25.5.1 ndbd — The NDB Cluster Data Node Daemon">
    Section 25.5.1, “ndbd — The NDB Cluster Data Node Daemon”
   </a>
   , for additional
        information about running NDB Cluster data nodes that apply to
        both the single-threaded and multithreaded versions of the data
        node process.
  </p>
  <p>
   Command-line options and configuration parameters used with
   <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>
   also apply to
   <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>
   .
        For more information about these options and parameters, see
   <a class="xref" href="mysql-cluster-programs-ndbd.html" title="25.5.1 ndbd — The NDB Cluster Data Node Daemon">
    Section 25.5.1, “ndbd — The NDB Cluster Data Node Daemon”
   </a>
   , and
   <a class="xref" href="mysql-cluster-ndbd-definition.html" title="25.4.3.6 Defining NDB Cluster Data Nodes">
    Section 25.4.3.6, “Defining NDB Cluster Data Nodes”
   </a>
   , respectively.
  </p>
  <p>
   <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>
   is also file system-compatible with
   <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>
   . In other words, a data node running
   <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>
   can be stopped, the binary replaced with
   <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>
   , and then restarted without any loss
        of data. (However, when doing this, you must make sure that
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbmtd-maxnoofexecutionthreads">
    <code class="literal">
     MaxNoOfExecutionThreads
    </code>
   </a>
   is set to an appropriate value before restarting the node if you
        wish for
   <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>
   to run in multithreaded
        fashion.) Similarly, an
   <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>
   binary can be
        replaced with
   <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>
   simply by stopping the
        node and then starting
   <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>
   in place of the
        multithreaded binary. It is not necessary when switching between
        the two to start the data node binary using
   <a class="link" href="mysql-cluster-programs-ndbd.html#option_ndbd_initial">
    <code class="option">
     --initial
    </code>
   </a>
   .
  </p>
  <p>
   Using
   <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>
   differs from using
   <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>
   in two key respects:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Because
      <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>
      runs by default in
            single-threaded mode (that is, it behaves like
      <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>
      ), you must configure it to use
            multiple threads. This can be done by setting an appropriate
            value in the
      <code class="filename">
       config.ini
      </code>
      file for the
      <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbmtd-maxnoofexecutionthreads">
       <code class="literal">
        MaxNoOfExecutionThreads
       </code>
      </a>
      configuration parameter or the
      <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbmtd-threadconfig">
       <code class="literal">
        ThreadConfig
       </code>
      </a>
      configuration parameter. Using
      <code class="literal">
       MaxNoOfExecutionThreads
      </code>
      is simpler, but
      <code class="literal">
       ThreadConfig
      </code>
      offers more flexibility. For
            more information about these configuration parameters and
            their use, see
      <a class="xref" href="mysql-cluster-ndbd-definition.html#mysql-cluster-ndbd-definition-ndbmtd-parameters" title="Multi-Threading Configuration Parameters (ndbmtd)">
       Multi-Threading Configuration Parameters (ndbmtd)
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Trace files are generated by critical errors in
      <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 in a somewhat different
            fashion from how these are generated by
      <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>
      failures. These differences are
            discussed in more detail in the next few paragraphs.
     </p>
    </li>
   </ol>
  </div>
  <a class="indexterm" name="idm46045107241600">
  </a>
  <a class="indexterm" name="idm46045107240112">
  </a>
  <a class="indexterm" name="idm46045107238624">
  </a>
  <a class="indexterm" name="idm46045107237136">
  </a>
  <a class="indexterm" name="idm46045107235648">
  </a>
  <p>
   Like
   <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>
   ,
   <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>
   generates a set of log files which are placed in the directory
        specified by
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datadir">
    <code class="literal">
     DataDir
    </code>
   </a>
   in
        the
   <code class="filename">
    config.ini
   </code>
   configuration file. Except
        for trace files, these are generated in the same way and have
        the same names as those generated by
   <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>
   .
  </p>
  <p>
   In the event of a critical error,
   <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>
   generates trace files describing what happened just prior to the
        error' occurrence. These files, which can be found in the
        data node's
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datadir">
    <code class="literal">
     DataDir
    </code>
   </a>
   , are useful for
        analysis of problems by the NDB Cluster Development and Support
        teams. One trace file is generated for each
   <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>
   thread. The names of these files have
        the following pattern:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa94918804"><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">ndb_<em class="replaceable">node_id</em>_trace<span class="token punctuation">.</span>log<span class="token punctuation">.</span><em class="replaceable">trace_id</em>_t<em class="replaceable">thread_id</em><span class="token punctuation">,</span></code></pre>
  </div>
  <p>
   In this pattern,
   <em class="replaceable">
    <code>
     node_id
    </code>
   </em>
   stands for
        the data node's unique node ID in the cluster,
   <em class="replaceable">
    <code>
     trace_id
    </code>
   </em>
   is a trace sequence number,
        and
   <em class="replaceable">
    <code>
     thread_id
    </code>
   </em>
   is the thread ID. For
        example, in the event of the failure of an
   <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>
   process running as an NDB Cluster data
        node having the node ID 3 and with
   <a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbmtd-maxnoofexecutionthreads">
    <code class="literal">
     MaxNoOfExecutionThreads
    </code>
   </a>
   equal to 4, four trace files are generated in the data
        node's data directory. If the is the first time this node
        has failed, then these files are named
   <code class="filename">
    ndb_3_trace.log.1_t1
   </code>
   ,
   <code class="filename">
    ndb_3_trace.log.1_t2
   </code>
   ,
   <code class="filename">
    ndb_3_trace.log.1_t3
   </code>
   , and
   <code class="filename">
    ndb_3_trace.log.1_t4
   </code>
   . Internally, these
        trace files follow the same format as
   <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>
   trace files.
  </p>
  <p>
   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>
   exit codes and messages that are
        generated when a data node process shuts down prematurely are
        also used by
   <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>
   . See
   <a class="ulink" href="/doc/ndb-internals/en/ndb-node-error-messages.html" target="_top">
    Data Node Error Messages
   </a>
   , for a listing of
        these.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    It is possible to use
    <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>
    and
    <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>
    concurrently on different data nodes
          in the same NDB Cluster. However, such configurations have not
          been tested extensively; thus, we cannot recommend doing so in
          a production setting at this time.
   </p>
  </div>
 </div>
 <br/>
</div>
