This section describes a process for configuring and starting GTID-based replication in MySQL 5.6.
This is a “cold start” procedurę that assumes either that you are starting the replication master for
the firsttime, or that it is possible to stop it; for information about provisioning replication slaves using
GTlDs from a running master, see Section 16.1.3.3, “Using GTlDs for Failover and Scaleout".
The key steps in this startup process for the simplest possible GTID replication
topology—consisting of
one master and one slave—are as follows:
1. If replication is already running, synchronize both servers by making them read-only.
2. Stop both servers.
3. Restart both servers with GTlDs, binary logging, and slave update logging enabled, and with
statements that are unsafefor GTID-based replication disabled. In addition, the sen/ers should be
started in read-only modę, and the slave SQL and l/O threads should be prevented from starting on the slave.
The mysąld options necessary to start the sen/ers as described are discussed in
the example that
follows later in this section.
4. Instruct the slave to use the master as the replication data source and to use auto-positioning, and
then start the slave.
The SQL statements needed to accomplish this step are described in the example that follows later in this section.
5. Disable read-only modę on both sen/ers, so that they can once again accept updates.
We now present a morę detailed example. We assume two sen/ers already running as master and
slave, using MySQL's “classic" file-based replication protocol.
Most of the steps that follow require the use of the MySQL root account or another MySQL user
account that has the SUPER [776] privilege. mysqladmin shutdown requires either the SUPER
prK/ilege or the SHUTDOWN [776] prh/ilege.