<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="mysql-cluster-installation">
      </a>
      25.3 NDB Cluster Installation
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="mysql-cluster-install-linux.html">
       25.3.1 Installation of NDB Cluster on Linux
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-install-windows.html">
       25.3.2 Installing NDB Cluster on Windows
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-install-configuration.html">
       25.3.3 Initial Configuration of NDB Cluster
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-install-first-start.html">
       25.3.4 Initial Startup of NDB Cluster
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-install-example-data.html">
       25.3.5 NDB Cluster Example with Tables and Data
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-install-shutdown-restart.html">
       25.3.6 Safe Shutdown and Restart of NDB Cluster
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-upgrade-downgrade.html">
       25.3.7 Upgrading and Downgrading NDB Cluster
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045123109936">
  </a>
  <a class="indexterm" name="idm46045123108864">
  </a>
  <a class="indexterm" name="idm46045123107792">
  </a>
  <a class="indexterm" name="idm46045123106304">
  </a>
  <a class="indexterm" name="idm46045123105232">
  </a>
  <p>
   This section describes the basics for planning, installing,
    configuring, and running an NDB Cluster. Whereas the examples in
   <a class="xref" href="mysql-cluster-configuration.html" title="25.4 Configuration of NDB Cluster">
    Section 25.4, “Configuration of NDB Cluster”
   </a>
   provide more in-depth
    information on a variety of clustering options and configuration,
    the result of following the guidelines and procedures outlined here
    should be a usable NDB Cluster which meets the
   <span class="emphasis">
    <em>
     minimum
    </em>
   </span>
   requirements for availability and
    safeguarding of data.
  </p>
  <p>
   For information about upgrading or downgrading an NDB Cluster
    between release versions, see
   <a class="xref" href="mysql-cluster-upgrade-downgrade.html" title="25.3.7 Upgrading and Downgrading NDB Cluster">
    Section 25.3.7, “Upgrading and Downgrading NDB Cluster”
   </a>
   .
  </p>
  <p>
   This section covers hardware and software requirements; networking
    issues; installation of NDB Cluster; basic configuration issues;
    starting, stopping, and restarting the cluster; loading of a sample
    database; and performing queries.
  </p>
  <p>
   <b>
    Assumptions.
   </b>
   The following sections make a number of assumptions regarding the
      cluster's physical and network configuration. These
      assumptions are discussed in the next few paragraphs.
  </p>
  <p>
   <a name="mysql-cluster-install-nodes-hosts">
   </a>
   <b>
    Cluster nodes and host computers.
   </b>
   The cluster consists of four nodes, each on a separate host
      computer, and each with a fixed network address on a typical
      Ethernet network as shown here:
  </p>
  <div class="table">
   <a name="idm46045123096512">
   </a>
   <p class="title">
    <b>
     Table 25.4 Network addresses of nodes in example cluster
    </b>
   </p>
   <div class="table-contents">
    <table>
     <colgroup>
      <col style="width: 50%"/>
      <col style="width: 50%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Node
       </th>
       <th>
        IP Address
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        Management node (
        <span class="command">
         <strong>
          mgmd
         </strong>
        </span>
        )
       </td>
       <td>
        198.51.100.10
       </td>
      </tr>
      <tr>
       <td>
        SQL node (
        <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
         <span class="command">
          <strong>
           mysqld
          </strong>
         </span>
        </a>
        )
       </td>
       <td>
        198.51.100.20
       </td>
      </tr>
      <tr>
       <td>
        Data node "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>
        )
       </td>
       <td>
        198.51.100.30
       </td>
      </tr>
      <tr>
       <td>
        Data node "B" (
        <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>
        )
       </td>
       <td>
        198.51.100.40
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <p>
   This setup is also shown in the following diagram:
  </p>
  <div class="figure">
   <a name="fig-mysql-cluster-multi-computer">
   </a>
   <p class="title">
    <b>
     Figure 25.4 NDB Cluster Multi-Computer Setup
    </b>
   </p>
   <div class="figure-contents">
    <div class="mediaobject">
     <img alt="Most content is described in the surrounding text. The four nodes each connect to a central switch that connects to a network." src="images/multi-comp-1.png" style="width: 100%; max-width: 550px;"/>
    </div>
   </div>
  </div>
  <br class="figure-break"/>
  <p>
   <b>
    Network addressing.
   </b>
   <a class="indexterm" name="idm46045123069952">
   </a>
   <a class="indexterm" name="idm46045123068464">
   </a>
   In the interest of simplicity (and reliability), this
   <em class="citetitle">
    How-To
   </em>
   uses only numeric IP addresses.
      However, if DNS resolution is available on your network, it is
      possible to use host names in lieu of IP addresses in configuring
      Cluster. Alternatively, you can use the
   <code class="filename">
    hosts
   </code>
   file (typically
   <code class="filename">
    /etc/hosts
   </code>
   for Linux and
      other Unix-like operating systems,
   <code class="filename">
    C:\WINDOWS\system32\drivers\etc\hosts
   </code>
   on
      Windows, or your operating system's equivalent) for providing
      a means to do host lookup if such is available.
  </p>
  <p>
   <code class="literal">
    NDB
   </code>
   8.4 supports IPv6 for
    connections between all NDB Cluster nodes.
  </p>
  <p>
   <b>
    Potential hosts file issues.
   </b>
   A common problem when trying to use host names for Cluster nodes
      arises because of the way in which some operating systems
      (including some Linux distributions) set up the system's own
      host name in the
   <code class="filename">
    /etc/hosts
   </code>
   during
      installation. Consider two machines with the host names
   <code class="literal">
    ndb1
   </code>
   and
   <code class="literal">
    ndb2
   </code>
   , both in the
   <code class="literal">
    cluster
   </code>
   network domain. Red Hat Linux
      (including some derivatives such as CentOS and Fedora) places the
      following entries in these machines'
   <code class="filename">
    /etc/hosts
   </code>
   files:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa81670398"><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-ini"><span class="token comment" spellcheck="true">#  ndb1 /etc/hosts:</span>
127.0.0.1   ndb1.cluster ndb1 localhost.localdomain localhost</code></pre>
  </div>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa68312983"><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-ini"><span class="token comment" spellcheck="true">#  ndb2 /etc/hosts:</span>
127.0.0.1   ndb2.cluster ndb2 localhost.localdomain localhost</code></pre>
  </div>
  <p>
   SUSE Linux (including OpenSUSE) places these entries in the
    machines'
   <code class="filename">
    /etc/hosts
   </code>
   files:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa51699949"><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-ini"><span class="token comment" spellcheck="true">#  ndb1 /etc/hosts:</span>
127.0.0.1       localhost
127.0.0.2       ndb1.cluster ndb1</code></pre>
  </div>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa88610707"><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-ini"><span class="token comment" spellcheck="true">#  ndb2 /etc/hosts:</span>
127.0.0.1       localhost
127.0.0.2       ndb2.cluster ndb2</code></pre>
  </div>
  <p>
   In both instances,
   <code class="literal">
    ndb1
   </code>
   routes
   <code class="literal">
    ndb1.cluster
   </code>
   to a loopback IP address, but gets a
    public IP address from DNS for
   <code class="literal">
    ndb2.cluster
   </code>
   ,
    while
   <code class="literal">
    ndb2
   </code>
   routes
   <code class="literal">
    ndb2.cluster
   </code>
   to a loopback address and obtains a public address for
   <code class="literal">
    ndb1.cluster
   </code>
   . The result is that each data node
    connects to the management server, but cannot tell when any other
    data nodes have connected, and so the data nodes appear to hang
    while starting.
  </p>
  <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Caution
   </div>
   <p>
    You cannot mix
    <code class="literal">
     localhost
    </code>
    and other host names
      or IP addresses in
    <code class="filename">
     config.ini
    </code>
    . For these
      reasons, the solution in such cases (other than to use IP
      addresses for
    <span class="emphasis">
     <em>
      all
     </em>
    </span>
    <code class="filename">
     config.ini
    </code>
    <code class="literal">
     HostName
    </code>
    entries) is to remove the fully qualified host names from
    <code class="filename">
     /etc/hosts
    </code>
    and use these in
    <code class="filename">
     config.ini
    </code>
    for all cluster hosts.
   </p>
  </div>
  <p>
   <b>
    Host computer type.
   </b>
   Each host computer in our installation scenario is an Intel-based
      desktop PC running a supported operating system installed to disk
      in a standard configuration, and running no unnecessary services.
      The core operating system with standard TCP/IP networking
      capabilities should be sufficient. Also for the sake of
      simplicity, we also assume that the file systems on all hosts are
      set up identically. In the event that they are not, you should
      adapt these instructions accordingly.
  </p>
  <p>
   <b>
    Network hardware.
   </b>
   Standard 100 Mbps or 1 gigabit Ethernet cards are installed on
      each machine, along with the proper drivers for the cards, and
      that all four hosts are connected through a standard-issue
      Ethernet networking appliance such as a switch. (All machines
      should use network cards with the same throughput. That is, all
      four machines in the cluster should have 100 Mbps cards
   <span class="emphasis">
    <em>
     or
    </em>
   </span>
   all four machines should have 1 Gbps
      cards.) NDB Cluster works in a 100 Mbps network; however, gigabit
      Ethernet provides better performance.
  </p>
  <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Important
   </div>
   <p>
    NDB Cluster is
    <span class="emphasis">
     <em>
      not
     </em>
    </span>
    intended for use in a
      network for which throughput is less than 100 Mbps or which
      experiences a high degree of latency. For this reason (among
      others), attempting to run an NDB Cluster over a wide area network
      such as the Internet is not likely to be successful, and is not
      supported in production.
   </p>
  </div>
  <p>
   <b>
    Sample data.
   </b>
   We use the
   <code class="literal">
    world
   </code>
   database which is available
      for download from the MySQL website (see
   <a class="ulink" href="/doc/index-other.html" target="_top">
    https://dev.mysql.com/doc/index-other.html
   </a>
   ). We assume that each
      machine has sufficient memory for running the operating system,
      required NDB Cluster processes, and (on the data nodes) storing
      the database.
  </p>
  <p>
   For general information about installing MySQL, see
   <a class="xref" href="installing.html" title="Chapter 2 Installing MySQL">
    Chapter 2,
    <i>
     Installing MySQL
    </i>
   </a>
   . For information about installation of
    NDB Cluster on Linux and other Unix-like operating systems, see
   <a class="xref" href="mysql-cluster-install-linux.html" title="25.3.1 Installation of NDB Cluster on Linux">
    Section 25.3.1, “Installation of NDB Cluster on Linux”
   </a>
   . For information about
    installation of NDB Cluster on Windows operating systems, see
   <a class="xref" href="mysql-cluster-install-windows.html" title="25.3.2 Installing NDB Cluster on Windows">
    Section 25.3.2, “Installing NDB Cluster on Windows”
   </a>
   .
  </p>
  <p>
   For general information about NDB Cluster hardware, software, and
    networking requirements, see
   <a class="xref" href="mysql-cluster-overview-requirements.html" title="25.2.3 NDB Cluster Hardware, Software, and Networking Requirements">
    Section 25.2.3, “NDB Cluster Hardware, Software, and Networking Requirements”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
