<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="mysql-cluster-config-file">
      </a>
      25.4.3 NDB Cluster Configuration Files
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="mysql-cluster-config-example.html">
       25.4.3.1 NDB Cluster Configuration: Basic Example
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-config-starting.html">
       25.4.3.2 Recommended Starting Configuration for NDB Cluster
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-connection-strings.html">
       25.4.3.3 NDB Cluster Connection Strings
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-computer-definition.html">
       25.4.3.4 Defining Computers in an NDB Cluster
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-mgm-definition.html">
       25.4.3.5 Defining an NDB Cluster Management Server
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-ndbd-definition.html">
       25.4.3.6 Defining NDB Cluster Data Nodes
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-api-definition.html">
       25.4.3.7 Defining SQL and Other API Nodes in an NDB Cluster
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-system-definition.html">
       25.4.3.8 Defining the System
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-options-variables.html">
       25.4.3.9 MySQL Server Options and Variables for NDB Cluster
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-tcp-definition.html">
       25.4.3.10 NDB Cluster TCP/IP Connections
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-tcp-definition-direct.html">
       25.4.3.11 NDB Cluster TCP/IP Connections Using Direct Connections
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-shm-definition.html">
       25.4.3.12 NDB Cluster Shared-Memory Connections
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-data-node-memory-management.html">
       25.4.3.13 Data Node Memory Management
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-config-send-buffers.html">
       25.4.3.14 Configuring NDB Cluster Send Buffer Parameters
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045120787392">
  </a>
  <a class="indexterm" name="idm46045120785904">
  </a>
  <a class="indexterm" name="idm46045120784416">
  </a>
  <p>
   Configuring NDB Cluster requires working with two files:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="filename">
       my.cnf
      </code>
      : Specifies options for all NDB
          Cluster executables. This file, with which you should be
          familiar with from previous work with MySQL, must be
          accessible by each executable running in the cluster.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="filename">
       config.ini
      </code>
      : This file, sometimes known as
          the
      <span class="firstterm">
       global configuration
          file
      </span>
      , is read only by the NDB Cluster management
          server, which then distributes the information contained
          therein to all processes participating in the cluster.
      <code class="filename">
       config.ini
      </code>
      contains a description of each
          node involved in the cluster. This includes configuration
          parameters for data nodes and configuration parameters for
          connections between all nodes in the cluster. For a quick
          reference to the sections that can appear in this file, and
          what sorts of configuration parameters may be placed in each
          section, see
      <a class="link" href="mysql-cluster-config-example.html#mysql-cluster-config-ini-sections" title="Sections of the config.ini File">
       Sections of
          the
       <code class="filename">
        config.ini
       </code>
       File
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   <b>
    Caching of configuration data.
   </b>
   <code class="literal">
    NDB
   </code>
   uses
   <span class="firstterm">
    stateful
        configuration
   </span>
   . Rather than reading the global
        configuration file every time the management server is
        restarted, the management server caches the configuration the
        first time it is started, and thereafter, the global
        configuration file is read only when one of the following
        conditions is true:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <b>
       The management server is started using the --initial option.
      </b>
      When
      <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_initial">
       <code class="option">
        --initial
       </code>
      </a>
      is used, the
            global configuration file is re-read, any existing cache
            files are deleted, and the management server creates a new
            configuration cache.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       The management server is started using the --reload option.
      </b>
      The
      <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_reload">
       <code class="option">
        --reload
       </code>
      </a>
      option causes
            the management server to compare its cache with the global
            configuration file. If they differ, the management server
            creates a new configuration cache; any existing
            configuration cache is preserved, but not used. If the
            management server's cache and the global configuration
            file contain the same configuration data, then the existing
            cache is used, and no new cache is created.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       The management server is started using --config-cache=FALSE.
      </b>
      This disables
      <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_config-cache">
       <code class="option">
        --config-cache
       </code>
      </a>
      (enabled by
            default), and can be used to force the management server to
            bypass configuration caching altogether. In this case, the
            management server ignores any configuration files that may
            be present, always reading its configuration data from the
      <code class="filename">
       config.ini
      </code>
      file instead.
     </p>
    </li>
    <li class="listitem">
     <p>
      <b>
       No configuration cache is found.
      </b>
      In this case, the management server reads the global
            configuration file and creates a cache containing the same
            configuration data as found in the file.
     </p>
    </li>
   </ul>
  </div>
  <p>
   <b>
    Configuration cache files.
   </b>
   The management server by default creates configuration cache
        files in a directory named
   <code class="filename">
    mysql-cluster
   </code>
   in
        the MySQL installation directory. (If you build NDB Cluster from
        source on a Unix system, the default location is
   <code class="filename">
    /usr/local/mysql-cluster
   </code>
   .) This can be
        overridden at runtime by starting the management server with the
   <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_configdir">
    <code class="option">
     --configdir
    </code>
   </a>
   option.
        Configuration cache files are binary files named according to
        the pattern
   <code class="filename">
    ndb_
    <em class="replaceable">
     <code>
      node_id
     </code>
    </em>
    _config.bin.
    <em class="replaceable">
     <code>
      seq_id
     </code>
    </em>
   </code>
   ,
        where
   <em class="replaceable">
    <code>
     node_id
    </code>
   </em>
   is the management
        server's node ID in the cluster, and
   <em class="replaceable">
    <code>
     seq_id
    </code>
   </em>
   is a cache identifier. Cache
        files are numbered sequentially using
   <em class="replaceable">
    <code>
     seq_id
    </code>
   </em>
   , in the order in which they
        are created. The management server uses the latest cache file as
        determined by the
   <em class="replaceable">
    <code>
     seq_id
    </code>
   </em>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    It is possible to roll back to a previous configuration by
        deleting later configuration cache files, or by renaming an
        earlier cache file so that it has a higher
    <em class="replaceable">
     <code>
      seq_id
     </code>
    </em>
    . However, since configuration
        cache files are written in a binary format, you should not
        attempt to edit their contents by hand.
   </p>
  </div>
  <p>
   For more information about the
   <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_configdir">
    <code class="option">
     --configdir
    </code>
   </a>
   ,
   <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_config-cache">
    <code class="option">
     --config-cache
    </code>
   </a>
   ,
   <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_initial">
    <code class="option">
     --initial
    </code>
   </a>
   , and
   <a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_reload">
    <code class="option">
     --reload
    </code>
   </a>
   options for the NDB
      Cluster management server, see
   <a class="xref" href="mysql-cluster-programs-ndb-mgmd.html" title="25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon">
    Section 25.5.4, “ndb_mgmd — The NDB Cluster Management Server Daemon”
   </a>
   .
  </p>
  <p>
   We are continuously making improvements in NDB Cluster
      configuration and attempting to simplify this process. Although we
      strive to maintain backward compatibility, there may be times when
      introduce an incompatible change. In such cases we try to let NDB
      Cluster users know in advance if a change is not backward
      compatible. If you find such a change and we have not documented
      it, please report it in the MySQL bugs database using the
      instructions given in
   <a class="xref" href="bug-reports.html" title="1.6 How to Report Bugs or Problems">
    Section 1.6, “How to Report Bugs or Problems”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
