<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-install-linux-source">
      </a>
      25.3.1.4 Building NDB Cluster from Source on Linux
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045122645584">
  </a>
  <a class="indexterm" name="idm46045122644096">
  </a>
  <p>
   This section provides information about compiling NDB Cluster on
        Linux and other Unix-like platforms. Building NDB Cluster from
        source is similar to building the standard MySQL Server,
        although it differs in a few key respects discussed here. For
        general information about building MySQL from source, see
   <a class="xref" href="source-installation.html" title="2.8 Installing MySQL from Source">
    Section 2.8, “Installing MySQL from Source”
   </a>
   . For information about
        compiling NDB Cluster on Windows platforms, see
   <a class="xref" href="mysql-cluster-install-windows-source.html" title="25.3.2.2 Compiling and Installing NDB Cluster from Source on Windows">
    Section 25.3.2.2, “Compiling and Installing NDB Cluster from Source on Windows”
   </a>
   .
  </p>
  <p>
   MySQL NDB Cluster 8.4 is built from the MySQL
        Server 8.4 sources, available from the MySQL
        downloads page at
   <a class="ulink" href="https://dev.mysql.com/downloads/" target="_top">
    https://dev.mysql.com/downloads/
   </a>
   . The
        archived source file should have a name similar to
   <code class="filename">
    mysql-8.4.0.tar.gz
   </code>
   . You
        can also obtain the sources from GitHub at
   <a class="ulink" href="https://github.com/mysql/mysql-server" target="_blank">
    https://github.com/mysql/mysql-server
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="source-configuration-options.html#option_cmake_with_ndb">
    <code class="option">
     WITH_NDB
    </code>
   </a>
   option for
   <span class="command">
    <strong>
     CMake
    </strong>
   </span>
   causes the binaries for the management
        nodes, data nodes, and other NDB Cluster programs to be built;
        it also causes
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   to be compiled with
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   storage engine support. This
        option is required when building NDB Cluster.
  </p>
  <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Important
   </div>
   <p>
    The
    <a class="link" href="source-configuration-options.html#option_cmake_with_ndb_java">
     <code class="option">
      WITH_NDB_JAVA
     </code>
    </a>
    option is
          enabled by default. This means that, by default, if
    <span class="command">
     <strong>
      CMake
     </strong>
    </span>
    cannot find the location of Java on
          your system, the configuration process fails; if you do not
          wish to enable Java and ClusterJ support, you must indicate
          this explicitly by configuring the build using
    <code class="option">
     -DWITH_NDB_JAVA=OFF
    </code>
    . Use
    <a class="link" href="source-configuration-options.html#option_cmake_with_classpath">
     <code class="option">
      WITH_CLASSPATH
     </code>
    </a>
    to provide the
          Java classpath if needed.
   </p>
  </div>
  <p>
   For more information about
   <span class="command">
    <strong>
     CMake
    </strong>
   </span>
   options
        specific to building NDB Cluster, see
   <a class="xref" href="source-configuration-options.html#cmake-mysql-cluster-options" title="CMake Options for Compiling NDB Cluster">
    CMake Options for Compiling NDB Cluster
   </a>
   .
  </p>
  <p>
   After you have run
   <span class="command">
    <strong>
     make &amp;&amp; make
        install
    </strong>
   </span>
   (or your system's equivalent), the result
        is similar to what is obtained by unpacking a precompiled binary
        to the same location.
  </p>
  <p>
   <b>
    Management nodes.
   </b>
   When building from source and running the default
   <span class="command">
    <strong>
     make install
    </strong>
   </span>
   , the management server and
          management client binaries (
   <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
   <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>
   ) can be found in
   <code class="filename">
    /usr/local/mysql/bin
   </code>
   . Only
   <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>
   is required to be present on a
          management node host; however, it is also a good idea to have
   <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>
   present on the same host machine.
          Neither of these executables requires a specific location on
          the host machine's file system.
  </p>
  <p>
   <b>
    Data nodes.
   </b>
   The only executable required on a data node host is the data
          node binary
   <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>
   . (
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   , for
          example, does not have to be present on the host machine.) By
          default, when building from source, this file is placed in the
          directory
   <code class="filename">
    /usr/local/mysql/bin
   </code>
   . For
          installing on multiple data node hosts, only
   <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>
   need be
          copied to the other host machine or machines. (This assumes
          that all data node hosts use the same architecture and
          operating system; otherwise you may need to compile separately
          for each different platform.) The data node binary need not be
          in any particular location on the host's file system, as long
          as the location is known.
  </p>
  <p>
   When compiling NDB Cluster from source, no special options are
        required for building multithreaded data node binaries.
        Configuring the build with
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   storage engine support causes
   <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 be
        built automatically;
   <span class="command">
    <strong>
     make install
    </strong>
   </span>
   places the
   <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 in the installation
   <code class="filename">
    bin
   </code>
   directory along with
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   ,
   <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-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client">
    <span class="command">
     <strong>
      ndb_mgm
     </strong>
    </span>
   </a>
   .
  </p>
  <p>
   <b>
    SQL nodes.
   </b>
   If you compile MySQL with clustering support, and perform the
          default installation (using
   <span class="command">
    <strong>
     make install
    </strong>
   </span>
   as
          the system
   <code class="literal">
    root
   </code>
   user),
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   is placed in
   <code class="filename">
    /usr/local/mysql/bin
   </code>
   . Follow the steps
          given in
   <a class="xref" href="source-installation.html" title="2.8 Installing MySQL from Source">
    Section 2.8, “Installing MySQL from Source”
   </a>
   to make
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   ready for use. If you want to run
          multiple SQL nodes, you can use a copy of the same
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   executable and its associated
          support files on several machines. The easiest way to do this
          is to copy the entire
   <code class="filename">
    /usr/local/mysql
   </code>
   directory and all directories and files contained within it to
          the other SQL node host or hosts, then repeat the steps from
   <a class="xref" href="source-installation.html" title="2.8 Installing MySQL from Source">
    Section 2.8, “Installing MySQL from Source”
   </a>
   on each machine. If you
          configure the build with a nondefault
   <code class="option">
    PREFIX
   </code>
   option, you must adjust the directory accordingly.
  </p>
  <p>
   In
   <a class="xref" href="mysql-cluster-install-configuration.html" title="25.3.3 Initial Configuration of NDB Cluster">
    Section 25.3.3, “Initial Configuration of NDB Cluster”
   </a>
   , we
        create configuration files for all of the nodes in our example
        NDB Cluster.
  </p>
 </div>
 <br/>
</div>
