content_image/667656.jpg content_image/667670.jpg
servers, two source servers on the source cluster and two replica servers on the replica cluster. For purposes of the discussion that follows, we assume that unique identifiers are assigned as shown here: 

<img src='content_image/667656.jpg'>

Setting up replication with two channels is not radically different from setting up a single replication channel. First, the mysqld  processes for the primary and secondary replication source servers must be started, followed by those for the primary and secondary replicas. The replication processes can be initiated by issuing the START REPLICA | SLAVE  statement on each of the replicas. The commands and the order in which they need to be issued are shown here: 

1. Start the primary replication source: 

shell S > mysqld --ndbcluster --server-id=1 \ --log-bin & 

2. Start the secondary replication source: 

shell S’ > mysqld --ndbcluster --server-id=2 \ --log-bin & 

3. Start the primary replica server: 

shell R > mysqld --ndbcluster --server-id=3 \ --skip-slave-start & 

4. Start the secondary replica server: 

shell R’ > mysqld --ndbcluster --server-id=4 \ --skip-slave-start & 

5. Finally, initiate replication on the primary channel by executing the START REPLICA | SLAVE statement on the primary replica as shown here: 

mysql R > START SLAVE; 

Beginning with MySQL 8.0.22, you can also use the following statement: 

mysql R > START REPLICA; 

<img src='content_image/667670.jpg'>

## Warning 

Only the primary channel must be started at this point. The secondary replication channel needs to be started only in the event that the primary replication channel fails, as described in Section 23.6.8, “Implementing Failover with NDB Cluster Replication” . Running multiple replication channels simultaneously can result in unwanted duplicate records being created on the replicas. 

As mentioned previously, it is not necessary to enable binary logging on the replicas. 

## 23.6.8 Implementing Failover with NDB Cluster Replication 

