NDB Cluster Backups With NDB Cluster Replication 8. Using the values obtained in the previous step, you can now issue the appropriate  CHANGE REPLICATION SOURCE TO  statement (MySQL 8.0.23 and later) or  CHANGE MASTER TO  statement (prior to MySQL 8.0.23) in the replica’s  mysql  client: 9. Now that the replica knows from what point in which binary log file to start reading data from the source, you can cause the replica to begin replicating with this statement: 23.6.9.1 NDB Cluster Replication: Automating Synchronization of the Replica to the Source Binary Log It is possible to automate much of the process described in the previous section (see Section 23.6.9, “NDB Cluster Backups With NDB Cluster Replication” ). The following Perl script  reset-replica.pl  serves as an example of how you can do this. For additional information on performing Cluster backups and restoring Cluster from backups, see Section 23.5.8, “Online Backup of NDB Cluster” . To perform a backup and restore on a second replication channel, it is necessary only to repeat these steps, substituting the host names and IDs of the secondary source and replica for those of the primary source and replica servers where appropriate, and running the preceding statements on them. Beginning with MySQL 8.0.22, you can also use the following statement: In MySQL 8.0.23 and later, you can also use the following statement: mysql R >  CHANGE MASTER TO -> MASTER_LOG_FILE=’@file’, -> MASTER_LOG_POS=@pos; mysql R >  CHANGE REPLICATION SOURCE TO -> SOURCE_LOG_FILE=’@file’, -> SOURCE_LOG_POS=@pos; mysql R >  START SLAVE; mysql R >  START REPLICA; #!/user/bin/perl -w # file: reset-replica.pl # Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to: # Free Software Foundation, Inc. # 59 Temple Place, Suite 330 # Boston, MA 02111-1307 USA # # Version 1.1 ######################## Includes ############################### 4633