content_image/825344.jpg content_image/825345.jpg content_image/825346.jpg content_image/825347.jpg
1. Start the MySQL replication source server by issuing this command, where id  is this server’s unique ID (see Section 23.6.2, “General Requirements for NDB Cluster Replication” ): 

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

This starts the server’s mysqld  process with binary logging enabled using the proper logging format. It is also necessary in NDB 8.0 to enable logging of updates to NDB  tables explicitly, using the --ndb- log-bin  option; this is a change from previous versions of NDB Cluster, in which this option was enabled by default. 

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

2. Start the MySQL replica server as shown here: 

shell R > mysqld --ndbcluster --server-id= id  & 

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

## Note 

You can also start the source with --binlog-format=MIXED , in which case row-based replication is used automatically when replicating between clusters. Statement-based binary logging is not supported for NDB Cluster Replication (see Section 23.6.2, “General Requirements for NDB Cluster Replication” ). 

In the command just shown, id  is the replica server’s unique ID. It is not necessary to enable logging on the replica. 

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

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

## Note 

Unless you want replication to begin immediately, delay the start of the replication threads until the appropriate START REPLICA | SLAVE  statement has been issued, as explained in Step 4 below. You can do this by starting the replica with the --skip-slave-start  option on the command line, by including skip-slave-start  in the replica’s my.cnf  file, or in MySQL 8.0.24 and later, by setting the skip_slave_start  system variable. 

3. It is necessary to synchronize the replica server with the source server’s replication binary log. If binary logging has not previously been running on the source, run the following statement on the replica: 

mysql R > CHANGE MASTER TO -> MASTER_LOG_FILE=’’, -> MASTER_LOG_POS=4; 

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

mysql R > CHANGE REPLICATION SOURCE TO -> SOURCE_LOG_FILE=’’, -> SOURCE_LOG_POS=4; 

This instructs the replica to begin reading the source server’s binary log from the log’s starting point. Otherwise—that is, if you are loading data from the source using a backup—see Section 23.6.8, “Implementing Failover with NDB Cluster Replication” , for information on how to obtain the correct values to use for MASTER_LOG_FILE  and MASTER_LOG_POS  in such cases. 

