<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-install-linux-binary">
      </a>
      25.3.1.1 Installing an NDB Cluster Binary Release on Linux
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045123010192">
  </a>
  <a class="indexterm" name="idm46045123008704">
  </a>
  <p>
   This section covers the steps necessary to install the correct
        executables for each type of Cluster node from precompiled
        binaries supplied by Oracle.
  </p>
  <p>
   For setting up a cluster using precompiled binaries, the first
        step in the installation process for each cluster host is to
        download the binary archive from the
   <a class="ulink" href="https://dev.mysql.com/downloads/cluster/" target="_top">
    NDB Cluster downloads
        page
   </a>
   . (For the most recent 64-bit NDB 8.4 release, this
        is
   <code class="filename">
    mysql-cluster-gpl-8.4.0-linux-glibc2.12-x86_64.tar.gz
   </code>
   .)
        We assume that you have placed this file in each machine's
   <code class="filename">
    /var/tmp
   </code>
   directory.
  </p>
  <p>
   If you require a custom binary, see
   <a class="xref" href="installing-development-tree.html" title="2.8.5 Installing MySQL Using a Development Source Tree">
    Section 2.8.5, “Installing MySQL Using a Development Source Tree”
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    After completing the installation, do not yet start any of the
          binaries. We show you how to do so following the configuration
          of the nodes (see
    <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>
    ).
   </p>
  </div>
  <p>
   <b>
    SQL nodes.
   </b>
   On each of the machines designated to host SQL nodes, perform
          the following steps as the system
   <code class="literal">
    root
   </code>
   user:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Check your
      <code class="filename">
       /etc/passwd
      </code>
      and
      <code class="filename">
       /etc/group
      </code>
      files (or use whatever tools
            are provided by your operating system for managing users and
            groups) to see whether there is already a
      <code class="literal">
       mysql
      </code>
      group and
      <code class="literal">
       mysql
      </code>
      user on the system. Some OS distributions create these as
            part of the operating system installation process. If they
            are not already present, create a new
      <code class="literal">
       mysql
      </code>
      user group, and then add a
      <code class="literal">
       mysql
      </code>
      user to this group:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa38081118"><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">groupadd</span> mysql
<span class="token prompt">$&gt; </span><span class="token command">useradd</span> <span class="token property">-g</span> mysql <span class="token property">-s</span> /bin/false mysql</code></pre>
     </div>
     <p>
      The syntax for
      <span class="command">
       <strong>
        useradd
       </strong>
      </span>
      and
      <span class="command">
       <strong>
        groupadd
       </strong>
      </span>
      may differ slightly on different
            versions of Unix, or they may have different names such as
      <span class="command">
       <strong>
        adduser
       </strong>
      </span>
      and
      <span class="command">
       <strong>
        addgroup
       </strong>
      </span>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Change location to the directory containing the downloaded
            file, unpack the archive, and create a symbolic link named
      <code class="filename">
       mysql
      </code>
      to the
      <code class="filename">
       mysql
      </code>
      directory.
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       The actual file and directory names vary according to the
              NDB Cluster version number.
      </p>
     </div>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa98415522"><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">cd</span> /var/tmp
<span class="token prompt">$&gt; </span><span class="token command">tar</span> <span class="token property">-C</span> /usr/local <span class="token property">-xzvf</span> mysql-cluster-gpl-8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0-linux-glibc2<span class="token punctuation">.</span>12-x86_64<span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz
<span class="token prompt">$&gt; </span><span class="token command">ln</span> <span class="token property">-s</span> /usr/local/mysql-cluster-gpl-8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0-linux-glibc2<span class="token punctuation">.</span>12-x86_64 /usr/local/mysql</code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Change location to the
      <code class="filename">
       mysql
      </code>
      directory
            and set up the system databases using
      <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="server-options.html#option_mysqld_initialize">
       <code class="option">
        --initialize
       </code>
      </a>
      as shown here:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa92419177"><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">cd</span> mysql
<span class="token prompt">$&gt; </span><span class="token command">mysqld</span> <span class="token property">--initialize</span></code></pre>
     </div>
     <p>
      This generates a random password for the MySQL
      <code class="literal">
       root
      </code>
      account. If you do
      <span class="emphasis">
       <em>
        not
       </em>
      </span>
      want the random password to be
            generated, you can substitute the
      <a class="link" href="server-options.html#option_mysqld_initialize-insecure">
       <code class="option">
        --initialize-insecure
       </code>
      </a>
      option
            for
      <code class="option">
       --initialize
      </code>
      . In either case, you
            should review
      <a class="xref" href="data-directory-initialization.html" title="2.9.1 Initializing the Data Directory">
       Section 2.9.1, “Initializing the Data Directory”
      </a>
      , for
            additional information before performing this step. See also
      <a class="xref" href="mysql-secure-installation.html" title="6.4.2 mysql_secure_installation — Improve MySQL Installation Security">
       Section 6.4.2, “mysql_secure_installation — Improve MySQL Installation Security”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Set the necessary permissions for the MySQL server and data
            directories:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa77819048"><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">chown</span> <span class="token property">-R</span> root <span class="token punctuation">.</span>
<span class="token prompt">$&gt; </span><span class="token command">chown</span> <span class="token property">-R</span> mysql data
<span class="token prompt">$&gt; </span><span class="token command">chgrp</span> <span class="token property">-R</span> mysql <span class="token punctuation">.</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Copy the MySQL startup script to the appropriate directory,
            make it executable, and set it to start when the operating
            system is booted up:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa11911896"><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">cp</span> support-files/mysql<span class="token punctuation">.</span>server /etc/rc<span class="token punctuation">.</span>d/init<span class="token punctuation">.</span>d/
<span class="token prompt">$&gt; </span><span class="token command">chmod</span> +x /etc/rc<span class="token punctuation">.</span>d/init<span class="token punctuation">.</span>d/mysql<span class="token punctuation">.</span>server
<span class="token prompt">$&gt; </span><span class="token command">chkconfig</span> <span class="token property">--add</span> mysql<span class="token punctuation">.</span>server</code></pre>
     </div>
     <p>
      (The startup scripts directory may vary depending on your
            operating system and version—for example, in some
            Linux distributions, it is
      <code class="filename">
       /etc/init.d
      </code>
      .)
     </p>
     <p>
      Here we use Red Hat's
      <span class="command">
       <strong>
        chkconfig
       </strong>
      </span>
      for
            creating links to the startup scripts; use whatever means is
            appropriate for this purpose on your platform, such as
      <span class="command">
       <strong>
        update-rc.d
       </strong>
      </span>
      on Debian.
     </p>
    </li>
   </ol>
  </div>
  <p>
   Remember that the preceding steps must be repeated on each
        machine where an SQL node is to reside.
  </p>
  <p>
   <b>
    Data nodes.
   </b>
   Installation of the data nodes does not require the
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   binary. Only the NDB Cluster data
          node executable
   <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>
   (single-threaded) 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>
   (multithreaded) is required. These
          binaries can also be found in the
   <code class="filename">
    .tar.gz
   </code>
   archive. Again, we assume that you have placed this archive in
   <code class="filename">
    /var/tmp
   </code>
   .
  </p>
  <p>
   As system
   <code class="literal">
    root
   </code>
   (that is, after using
   <span class="command">
    <strong>
     sudo
    </strong>
   </span>
   ,
   <span class="command">
    <strong>
     su root
    </strong>
   </span>
   , or your
        system's equivalent for temporarily assuming the system
        administrator account's privileges), perform the following steps
        to install the data node binaries on the data node hosts:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Change location to the
      <code class="filename">
       /var/tmp
      </code>
      directory, and extract 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>
      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>
      binaries from the archive into a
            suitable directory such as
      <code class="filename">
       /usr/local/bin
      </code>
      :
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa44008824"><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">cd</span> /var/tmp
<span class="token prompt">$&gt; </span><span class="token command">tar</span> <span class="token property">-zxvf</span> mysql-cluster-gpl-8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0-linux-glibc2<span class="token punctuation">.</span>12-x86_64<span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz
<span class="token prompt">$&gt; </span><span class="token command">cd</span> mysql-cluster-gpl-8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0-linux-glibc2<span class="token punctuation">.</span>12-x86_64
<span class="token prompt">$&gt; </span><span class="token command">cp</span> bin/ndbd /usr/local/bin/ndbd
<span class="token prompt">$&gt; </span><span class="token command">cp</span> bin/ndbmtd /usr/local/bin/ndbmtd</code></pre>
     </div>
     <p>
      (You can safely delete the directory created by unpacking
            the downloaded archive, and the files it contains, from
      <code class="filename">
       /var/tmp
      </code>
      once
      <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>
      and
      <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>
      have been copied to the executables directory.)
     </p>
    </li>
    <li class="listitem">
     <p>
      Change location to the directory into which you copied the
            files, and then make both of them executable:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa23276035"><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">cd</span> /usr/local/bin
<span class="token prompt">$&gt; </span><span class="token command">chmod</span> +x ndb*</code></pre>
     </div>
    </li>
   </ol>
  </div>
  <p>
   The preceding steps should be repeated on each data node host.
  </p>
  <p>
   Although only one of the data node executables is required to
        run an NDB Cluster data node, we have shown you how to install
        both
   <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>
   in
        the preceding instructions. We recommend that you do this when
        installing or upgrading NDB Cluster, even if you plan to use
        only one of them, since this saves time and trouble in the event
        that you later decide to change from one to the other.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    The data directory on each machine hosting a data node is
    <code class="filename">
     /usr/local/mysql/data
    </code>
    . This piece of
          information is essential when configuring the management node.
          (See
    <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>
    .)
   </p>
  </div>
  <p>
   <b>
    Management nodes.
   </b>
   Installation of the management node does not require the
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   binary. Only the NDB Cluster
          management server (
   <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;
          you most likely want to install the management client
          (
   <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>
   ) as well. Both of these binaries
          also be found in the
   <code class="filename">
    .tar.gz
   </code>
   archive.
          Again, we assume that you have placed this archive in
   <code class="filename">
    /var/tmp
   </code>
   .
  </p>
  <p>
   As system
   <code class="literal">
    root
   </code>
   , perform the following steps
        to install
   <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>
   on the management node host:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Change location to the
      <code class="filename">
       /var/tmp
      </code>
      directory, and extract 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>
      and
      <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>
      from the archive into a suitable
            directory such as
      <code class="filename">
       /usr/local/bin
      </code>
      :
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa96655295"><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">cd</span> /var/tmp
<span class="token prompt">$&gt; </span><span class="token command">tar</span> <span class="token property">-zxvf</span> mysql-cluster-gpl-8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0-linux-glibc2<span class="token punctuation">.</span>12-x86_64<span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz
<span class="token prompt">$&gt; </span><span class="token command">cd</span> mysql-cluster-gpl-8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0-linux-glibc2<span class="token punctuation">.</span>12-x86_64
<span class="token prompt">$&gt; </span><span class="token command">cp</span> bin/ndb_mgm* /usr/local/bin</code></pre>
     </div>
     <p>
      (You can safely delete the directory created by unpacking
            the downloaded archive, and the files it contains, from
      <code class="filename">
       /var/tmp
      </code>
      once
      <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>
      and
      <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>
      have been copied to the executables directory.)
     </p>
    </li>
    <li class="listitem">
     <p>
      Change location to the directory into which you copied the
            files, and then make both of them executable:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa32557925"><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">cd</span> /usr/local/bin
<span class="token prompt">$&gt; </span><span class="token command">chmod</span> +x ndb_mgm*</code></pre>
     </div>
    </li>
   </ol>
  </div>
  <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>
