<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-cluster-tcp-definition-direct">
      </a>
      25.4.3.11 NDB Cluster TCP/IP Connections Using Direct Connections
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045109120800">
  </a>
  <a class="indexterm" name="idm46045109119312">
  </a>
  <a class="indexterm" name="idm46045109117408">
  </a>
  <p>
   Setting up a cluster using direct connections between data nodes
        requires specifying explicitly the crossover IP addresses of the
        data nodes so connected in the
   <code class="literal">
    [tcp]
   </code>
   section
        of the cluster
   <code class="filename">
    config.ini
   </code>
   file.
  </p>
  <p>
   In the following example, we envision a cluster with at least
        four hosts, one each for a management server, an SQL node, and
        two data nodes. The cluster as a whole resides on the
   <code class="literal">
    172.23.72.*
   </code>
   subnet of a LAN. In addition to
        the usual network connections, the two data nodes are connected
        directly using a standard crossover cable, and communicate with
        one another directly using IP addresses in the
   <code class="literal">
    1.1.0.*
   </code>
   address range as shown:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa56285852"><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"># Management Server</span>
<span class="token selector">[ndb_mgmd]</span>
<span class="token constant">Id</span><span class="token attr-value"><span class="token punctuation">=</span>1</span>
<span class="token constant">HostName</span><span class="token attr-value"><span class="token punctuation">=</span>172.23.72.20</span>

<span class="token comment" spellcheck="true"># SQL Node</span>
<span class="token selector">[mysqld]</span>
<span class="token constant">Id</span><span class="token attr-value"><span class="token punctuation">=</span>2</span>
<span class="token constant">HostName</span><span class="token attr-value"><span class="token punctuation">=</span>172.23.72.21</span>

<span class="token comment" spellcheck="true"># Data Nodes</span>
<span class="token selector">[ndbd]</span>
<span class="token constant">Id</span><span class="token attr-value"><span class="token punctuation">=</span>3</span>
<span class="token constant">HostName</span><span class="token attr-value"><span class="token punctuation">=</span>172.23.72.22</span>

<span class="token selector">[ndbd]</span>
<span class="token constant">Id</span><span class="token attr-value"><span class="token punctuation">=</span>4</span>
<span class="token constant">HostName</span><span class="token attr-value"><span class="token punctuation">=</span>172.23.72.23</span>

<span class="token comment" spellcheck="true"># TCP/IP Connections</span>
<span class="token selector">[tcp]</span>
<span class="token constant">NodeId1</span><span class="token attr-value"><span class="token punctuation">=</span>3</span>
<span class="token constant">NodeId2</span><span class="token attr-value"><span class="token punctuation">=</span>4</span>
<span class="token constant">HostName1</span><span class="token attr-value"><span class="token punctuation">=</span>1.1.0.1</span>
<span class="token constant">HostName2</span><span class="token attr-value"><span class="token punctuation">=</span>1.1.0.2</span></code></pre>
  </div>
  <p>
   The
   <a class="link" href="mysql-cluster-tcp-definition.html#ndbparam-tcp-hostname1">
    <code class="literal">
     HostName1
    </code>
   </a>
   and
   <a class="link" href="mysql-cluster-tcp-definition.html#ndbparam-tcp-hostname2">
    <code class="literal">
     HostName2
    </code>
   </a>
   parameters are
        used only when specifying direct connections.
  </p>
  <p>
   The use of direct TCP connections between data nodes can improve
        the cluster's overall efficiency by enabling the data nodes to
        bypass an Ethernet device such as a switch, hub, or router, thus
        cutting down on the cluster's latency.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    To take the best advantage of direct connections in this
          fashion with more than two data nodes, you must have a direct
          connection between each data node and every other data node in
          the same node group.
   </p>
  </div>
 </div>
 <br/>
</div>
