Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a dba.stackexchange
scroll top