use existing_replica_hostname -relay-bin.index . Alternatively, if you have already tried to start the new replica after following the remaining steps in this section and have encountered errors like those described previously, then perform the following steps: 

a. If you have not already done so, issue STOP REPLICA | SLAVE  on the new replica. 

If you have already started the existing replica again, issue STOP REPLICA | SLAVE  on the existing replica as well. 

b. Copy the contents of the existing replica’s relay log index file into the new replica’s relay log index file, making sure to overwrite any content already in the file. 

c. Proceed with the remaining steps in this section. 

4. When copying is complete, restart the existing replica. 

5. On the new replica, edit the configuration and give the new replica a unique server ID (using the server_id  system variable) that is not used by the source or any of the existing replicas. 

6. Start the new replica server, ensuring that replication does not start yet by specifying the --skip- slave-start  option, or from MySQL 8.0.24, the skip_slave_start  system variable. Use the Performance Schema replication tables or issue SHOW REPLICA | SLAVE STATUS  to confirm that the new replica has the correct settings when compared with the existing replica. Also display the server ID and server UUID and verify that these are correct and unique for the new replica. 

7. Start the replica threads by issuing a START REPLICA | SLAVE  statement. The new replica now uses the information in its connection metadata repository to start the replication process. 

## 17.1.3 Replication with Global Transaction Identifiers 

This section explains transaction-based replication using global transaction identifiers  (GTIDs). When using GTIDs, each transaction can be identified and tracked as it is committed on the originating server and applied by any replicas; this means that it is not necessary when using GTIDs to refer to log files or positions within those files when starting a new replica or failing over to a new source, which greatly simplifies these tasks. Because GTID-based replication is completely transaction-based, it is simple to determine whether sources and replicas are consistent; as long as all transactions committed on a source are also committed on a replica, consistency between the two is guaranteed. You can use either statement-based or row-based replication with GTIDs (see Section 17.2.1, “Replication Formats” ); however, for best results, we recommend that you use the row-based format. 

GTIDs are always preserved between source and replica. This means that you can always determine the source for any transaction applied on any replica by examining its binary log. In addition, once a transaction with a given GTID is committed on a given server, any subsequent transaction having the same GTID is ignored by that server. Thus, a transaction committed on the source can be applied no more than once on the replica, which helps to guarantee consistency. 

This section discusses the following topics: 

•How GTIDs are defined and created, and how they are represented in a MySQL server (see Section 17.1.3.1, “GTID Format and Storage” ). 

•The life cycle of a GTID (see Section 17.1.3.2, “GTID Life Cycle” ). 

•The auto-positioning function for synchronizing a replica and source that use GTIDs (see Section 17.1.3.3, “GTID Auto-Positioning” ). 

•A general procedure for setting up and starting GTID-based replication (see Section 17.1.3.4, “Setting Up Replication Using GTIDs” ). 

