1

In MySQL-5.7, we have both GTID and Traditional methods to setup MySQL replication.

We also have a new parameter:

gtid_mode = ON_PERMISSIVE

which means we can enable the GTID but also able to run replication in traditional way.

Now we have enabled the MySQL replication but how we can check that mysql replication is working over GTID or Traditional ?

Thanks

Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81
  • can you check `gtid_executed`? this should hold a complete log of al the `GTID` Transactions. see: https://dev.mysql.com/doc/refman/5.7/en/replication-options-gtids.html – RealCheeseLord Aug 24 '17 at 10:48

2 Answers2

0

If:

show global variables like 'gtid_executed';
-- OR respectively:
select @@gtid_executed; -- @@ returns Globally set variables, single @ returns session set variables

returns a Value, you are using GTID

If it does not, you are using "Traditional" replication

Ron
  • 5,900
  • 2
  • 20
  • 30
-1

From MySQL Documentation:

When gtid_mode=OFF_PERMISSIVE then new transactions are anonymous while permitting replicated transactions to be either GTID or anonymous transactions. When gtid_mode=ON_PERMISSIVE then new transactions use GTIDs while permitting replicated transactions to be either GTID or anonymous transactions

This mean that gtid_mode = ON PERMISSIVE allows to have transactions with anonymous replication (traditional way) although new transactions are being made with GTID, that's why new version allows topology with GTID or anonymous replication.

This will help you with your request:

Fields that display a single GTID, such as CURRENT_TRANSACTION in the replication_applier_status_by_worker Performance Schema table, now display ANONYMOUS when GTID transactions are not being used.

Regards

Alvaro Niño
  • 547
  • 1
  • 4
  • 17