4

I'm setting up 5.6 Percona Mysql, in order to enable GTID should I have to enable log_slave_update on both Master and Slave ?

If I should enable log_slave_update, then I'm counting this to CONS for having GTID.

Also if you can let me know any other issues in having GTID enabled?

0

1 Answer 1

2

The MySQL Documentation suggests it : See Setting Up Replication Using GTIDs

Keep in mind that MySQL won't even start up with it. Why ? From the Documentation:

Step 3: Restart both servers with GTIDs enabled. To enable binary logging with global transaction identifiers, each server must be started with GTID mode, binary logging, slave update logging enabled, and with statements that are unsafe for GTID-based replication disabled. In addition, you should prevent unwanted or accidental updates from being performed on either server by starting both in read-only mode. This means that both servers must be started with (at least) the options shown in the following invocation of mysqld_safe:

shell> mysqld_safe --gtid_mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency &

Since binary logging is active on both Master and Slave, the Master's binary logs and the Slave's binary logs will both have GTIDs recorded along with the transactions. This makes it possible for auto-positioning a Slave to its Master using the latest GTID in the Slave when starting Replication. One of the key steps clearly says in that same document page:

Instruct the slave to use the master as the replication data source and to use auto-positioning, and then start the slave.

Therefore, --log-slave-updates must be enabled in order for the auto-positioning mechanism to be active. Even just beyond the mechanism, @jynus points out in his answer to mysql 5.6 gtid replication: is log_slave_updates required? that mysqld won't even bother to start if --log-slave-updates is not specified.

3
  • @jynus you are right. I don't use GTID. I guess I am just old school since I am comfortable with binlog coordinates (file and position). I have seen coworkers in my past jobs set it up, have replication break for a variety of reasons, and have a difficult time setting replication back up with GTIDs. My current job does not use it either. Sep 9, 2014 at 22:25
  • Gotta commute home, I'll amend later. Sep 9, 2014 at 22:30
  • that is during 2014, how about 2019?
    – neobie
    Nov 17, 2019 at 2:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.