<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="mysql-cluster-replication">
      </a>
      25.7 NDB Cluster Replication
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-abbreviations.html">
       25.7.1 NDB Cluster Replication: Abbreviations and Symbols
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-general.html">
       25.7.2 General Requirements for NDB Cluster Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-issues.html">
       25.7.3 Known Issues in NDB Cluster Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-schema.html">
       25.7.4 NDB Cluster Replication Schema and Tables
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-preparation.html">
       25.7.5 Preparing the NDB Cluster for Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-starting.html">
       25.7.6 Starting NDB Cluster Replication (Single Replication Channel)
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-two-channels.html">
       25.7.7 Using Two Replication Channels for NDB Cluster Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-failover.html">
       25.7.8 Implementing Failover with NDB Cluster Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-backups.html">
       25.7.9 NDB Cluster Backups With NDB Cluster Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-multi-source.html">
       25.7.10 NDB Cluster Replication: Bidirectional and Circular Replication
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-mta.html">
       25.7.11 NDB Cluster Replication Using the Multithreaded Applier
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="mysql-cluster-replication-conflict-resolution.html">
       25.7.12 NDB Cluster Replication Conflict Resolution
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045086859680">
  </a>
  <a class="indexterm" name="idm46045086857776">
  </a>
  <a class="indexterm" name="idm46045086855872">
  </a>
  <a class="indexterm" name="idm46045086854800">
  </a>
  <a class="indexterm" name="idm46045086853344">
  </a>
  <p>
   NDB Cluster supports
   <span class="firstterm">
    asynchronous
    replication
   </span>
   , more usually referred to simply as
   <span class="quote">
    “
    <span class="quote">
     replication
    </span>
    ”
   </span>
   . This section explains how to set up and
    manage a configuration in which one group of computers operating as
    an NDB Cluster replicates to a second computer or group of
    computers. We assume some familiarity on the part of the reader with
    standard MySQL replication as discussed elsewhere in this Manual.
    (See
   <a class="xref" href="replication.html" title="Chapter 19 Replication">
    Chapter 19,
    <i>
     Replication
    </i>
   </a>
   ).
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    NDB Cluster does not support replication using GTIDs;
      semisynchronous replication and group replication are also not
      supported by the
    <code class="literal">
     NDB
    </code>
    storage engine.
   </p>
  </div>
  <p>
   Normal (non-clustered) replication involves a source server and a
    replica server, the source being so named because operations and
    data to be replicated originate with it, and the replica being the
    recipient of these. In NDB Cluster, replication is conceptually very
    similar but can be more complex in practice, as it may be extended
    to cover a number of different configurations including replicating
    between two complete clusters. Although an NDB Cluster itself
    depends on the
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   storage engine for
    clustering functionality, it is not necessary to use
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   as the storage engine for the
    replica's copies of the replicated tables (see
   <a class="xref" href="mysql-cluster-replication-issues.html#mysql-cluster-replication-ndb-to-non-ndb" title="Replication from NDB to other storage engines">
    Replication from NDB to other storage engines
   </a>
   ).
    However, for maximum availability, it is possible (and preferable)
    to replicate from one NDB Cluster to another, and it is this
    scenario that we discuss, as shown in the following figure:
  </p>
  <div class="figure">
   <a name="fig-mysql-cluster-cluster-replication">
   </a>
   <p class="title">
    <b>
     Figure 25.10 NDB Cluster-to-Cluster Replication Layout
    </b>
   </p>
   <div class="figure-contents">
    <div class="mediaobject">
     <img alt="Much of the content is described in the surrounding text. It visualizes how a MySQL source is replicated. The replica differs in that it shows an I/O (receiver) thread pointing to a relay binary log which points to an SQL (applier) thread. In addition, while the binary log points to and from the NDBCLUSTER engine on the source server, on the replica it points directly to an SQL node (MySQL server)." src="images/cluster-replication-overview.png" style="width: 100%; max-width: 716px;"/>
    </div>
   </div>
  </div>
  <br class="figure-break"/>
  <p>
   In this scenario, the replication process is one in which successive
    states of a source cluster are logged and saved to a replica
    cluster. This process is accomplished by a special thread known as
    the NDB binary log injector thread, which runs on each MySQL server
    and produces a binary log (
   <code class="literal">
    binlog
   </code>
   ). This thread
    ensures that all changes in the cluster producing the binary
    log—and not just those changes that are effected through the
    MySQL Server—are inserted into the binary log with the correct
    serialization order. We refer to the MySQL source and replica
    servers as replication servers or replication nodes, and the data
    flow or line of communication between them as a
   <span class="firstterm">
    replication channel
   </span>
   .
  </p>
  <p>
   For information about performing point-in-time recovery with NDB
    Cluster and NDB Cluster Replication, see
   <a class="xref" href="mysql-cluster-replication-pitr.html" title="25.7.9.2 Point-In-Time Recovery Using NDB Cluster Replication">
    Section 25.7.9.2, “Point-In-Time Recovery Using NDB Cluster Replication”
   </a>
   .
  </p>
  <a class="indexterm" name="idm46045086831712">
  </a>
  <a class="indexterm" name="idm46045086830256">
  </a>
  <p>
   <b>
    NDB API replica status variables.
   </b>
   NDB API counters can provide enhanced monitoring capabilities on
      replica clusters. These counters are implemented as NDB statistics
   <code class="literal">
    _replica
   </code>
   status variables, as seen in the
      output of
   <a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
    <code class="literal">
     SHOW STATUS
    </code>
   </a>
   , or in the
      results of queries against the Performance Schema
   <a class="link" href="performance-schema-status-variable-tables.html" title="29.12.15 Performance Schema Status Variable Tables">
    <code class="literal">
     session_status
    </code>
   </a>
   or
   <a class="link" href="performance-schema-status-variable-tables.html" title="29.12.15 Performance Schema Status Variable Tables">
    <code class="literal">
     global_status
    </code>
   </a>
   table in a
   <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
    <span class="command">
     <strong>
      mysql
     </strong>
    </span>
   </a>
   client session connected to a MySQL
      Server that is acting as a replica in NDB Cluster Replication. By
      comparing the values of these status variables before and after
      the execution of statements affecting replicated
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   tables, you can observe the
      corresponding actions taken on the NDB API level by the replica,
      which can be useful when monitoring or troubleshooting NDB Cluster
      Replication.
   <a class="xref" href="mysql-cluster-ndb-api-statistics.html" title="25.6.16 NDB API Statistics Counters and Variables">
    Section 25.6.16, “NDB API Statistics Counters and Variables”
   </a>
   ,
      provides additional information.
  </p>
  <p>
   <b>
    Replication from NDB to non-NDB tables.
   </b>
   It is possible to replicate
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   tables from an NDB Cluster acting as the replication source to
      tables using other MySQL storage engines such as
   <a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
    <code class="literal">
     InnoDB
    </code>
   </a>
   or
   <a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
    <code class="literal">
     MyISAM
    </code>
   </a>
   on a replica
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   . This is subject to a number of
      conditions; see
   <a class="xref" href="mysql-cluster-replication-issues.html#mysql-cluster-replication-ndb-to-non-ndb" title="Replication from NDB to other storage engines">
    Replication from NDB to other storage engines
   </a>
   , and
   <a class="xref" href="mysql-cluster-replication-issues.html#mysql-cluster-replication-ndb-to-nontransactional" title="Replication from NDB to a nontransactional storage engine">
    Replication from NDB to a nontransactional storage engine
   </a>
   ,
      for more information.
  </p>
 </div>
 <br/>
</div>
