#### 23.3.1.4 Building NDB Cluster from Source on Linux

[]()[]()

 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 [Section 2.9, “Installing MySQL from Source”](source-installation.html). For information about compiling NDB Cluster on Windows platforms, see [Section 23.3.2.2, “Compiling and Installing NDB Cluster from Source on Windows”](mysql-cluster-install-windows-source.html).

 Building MySQL NDB Cluster 8.0 requires using the MySQL Server 8.0 sources. These are available from the MySQL downloads page at [https://dev.mysql.com/downloads/](https://dev.mysql.com/downloads/). The archived source file should have a name similar to `mysql-8.0.28.tar.gz`. You can also obtain the sources from GitHub at [https://github.com/mysql/mysql-server](https://github.com/mysql/mysql-server).

Note

 In previous versions, building of NDB Cluster from standard MySQL Server sources was not supported. In MySQL 8.0 and NDB Cluster 8.0, this is no longer the case—*both products are now built from the same sources*.

 The [`WITH_NDBCLUSTER`](source-configuration-options.html#option_cmake_with_ndbcluster) option for **CMake** causes the binaries for the management nodes, data nodes, and other NDB Cluster programs to be built; it also causes [**mysqld**](mysqld.html) to be compiled with [`NDB`](mysql-cluster.html) storage engine support. This option (or one of its aliases `WITH_NDBCLUSTER_STORAGE_ENGINE` and `WITH_PLUGIN_NDBCLUSTER`) is required when building NDB Cluster.

Important

 The [`WITH_NDB_JAVA`](source-configuration-options.html#option_cmake_with_ndb_java) option is enabled by default. This means that, by default, if **CMake** 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 `-DWITH_NDB_JAVA=OFF`. Use [`WITH_CLASSPATH`](source-configuration-options.html#option_cmake_with_classpath) to provide the Java classpath if needed.

 For more information about **CMake** options specific to building NDB Cluster, see [Options for Compiling NDB Cluster](source-configuration-options.html#cmake-mysql-cluster-options).

 After you have run **make && make install** (or your system's equivalent), the result is similar to what is obtained by unpacking a precompiled binary to the same location.

**Management nodes.**  When building from source and running the default **make install**, the management server and management client binaries ([**ndb\_mgmd**](mysql-cluster-programs-ndb-mgmd.html) and [**ndb\_mgm**](mysql-cluster-programs-ndb-mgm.html)) can be found in `/usr/local/mysql/bin`. Only [**ndb\_mgmd**](mysql-cluster-programs-ndb-mgmd.html) is required to be present on a management node host; however, it is also a good idea to have [**ndb\_mgm**](mysql-cluster-programs-ndb-mgm.html) present on the same host machine. Neither of these executables requires a specific location on the host machine's file system.

**Data nodes.**  The only executable required on a data node host is the data node binary [**ndbd**](mysql-cluster-programs-ndbd.html) or [**ndbmtd**](mysql-cluster-programs-ndbmtd.html). ([**mysqld**](mysqld.html), 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 `/usr/local/mysql/bin`. For installing on multiple data node hosts, only [**ndbd**](mysql-cluster-programs-ndbd.html) or [**ndbmtd**](mysql-cluster-programs-ndbmtd.html) 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.

 When compiling NDB Cluster from source, no special options are required for building multithreaded data node binaries. Configuring the build with [`NDB`](mysql-cluster.html) storage engine support causes [**ndbmtd**](mysql-cluster-programs-ndbmtd.html) to be built automatically; **make install** places the [**ndbmtd**](mysql-cluster-programs-ndbmtd.html) binary in the installation `bin` directory along with [**mysqld**](mysqld.html), [**ndbd**](mysql-cluster-programs-ndbd.html), and [**ndb\_mgm**](mysql-cluster-programs-ndb-mgm.html).

**SQL nodes.**  If you compile MySQL with clustering support, and perform the default installation (using **make install** as the system `root` user), [**mysqld**](mysqld.html) is placed in `/usr/local/mysql/bin`. Follow the steps given in [Section 2.9, “Installing MySQL from Source”](source-installation.html) to make [**mysqld**](mysqld.html) ready for use. If you want to run multiple SQL nodes, you can use a copy of the same [**mysqld**](mysqld.html) executable and its associated support files on several machines. The easiest way to do this is to copy the entire `/usr/local/mysql` directory and all directories and files contained within it to the other SQL node host or hosts, then repeat the steps from [Section 2.9, “Installing MySQL from Source”](source-installation.html) on each machine. If you configure the build with a nondefault `PREFIX` option, you must adjust the directory accordingly.

 In [Section 23.3.3, “Initial Configuration of NDB Cluster”](mysql-cluster-install-configuration.html), we create configuration files for all of the nodes in our example NDB Cluster.

