Setting Up Replication Using GTIDs
This section describes a process for configuring and starting GTID-based replication in MySQL 5.6.
This is a “cold start” procedure that assumes either that you are starting the replication master for
the first time, or that it is possible to stop it; for information about provisioning replication slaves using
GTIDs from a running master, see Section 184.108.40.206, “Using GTIDs 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 GTIDs, binary logging, and slave update logging enabled, and with
statements that are unsafe for GTID-based replication disabled. In addition, the servers should be
started in read-only mode, and the slave SQL and I/O threads should be prevented from starting on
The mysqld options necessary to start the servers 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 mode on both servers, so that they can once again accept updates.
We now present a more detailed example. We assume two servers 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  privilege. mysqladmin shutdown requires either the SUPER
privilege or the SHUTDOWN  privilege.
... zobacz całą notatkę