I have a suggestion for this.
In the case of Galera Cluster, there are two GTID domains--gtid_domain_id and wsrep_gtid_domain_id. Only the domain defined by wsrep_gtid_domain_id is used for transactions that are replicated by Galera Cluster. The domain defined by gtid_domain_id is only used for transactions that are local to the node. This means that gtid_domain_id is likely to get out of sync between cluster nodes for all sorts of reasons.
I would suggest updating the documentation, so that DO_DOMAIN_IDS = (<wsrep_gtid_domain_id>) is set in the CHANGE MASTER command.
https://mariadb.com/kb/en/library/change-master-to/#do_domain_ids
However, it looks like MaxScale 2.3.8 doesn't support the DO_DOMAIN_IDS option yet, so it would have to be implemented first. I created MXS-2581 for this.
i.e. if wsrep_gtid_domain_id=2, then the command for the primary master would be:
# mysql -h $MAXSCALE_HOST -P $MAXCALE_PORT
|
MariaDB> SET @@global.gtid_slave_pos='0-198-123';
|
MariaDB> CHANGE MASTER TO
|
MASTER_HOST='192.168.10.5',
|
MASTER_PORT=3306,
|
MASTER_USER='repl',
|
MASTER_PASSWORD='repl',
|
MASTER_USE_GTID=Slave_pos,
|
DO_DOMAIN_IDS=(2);
|
And the command for the secondary master would be:
MariaDB> CHANGE MASTER ':2' TO
|
MASTER_HOST='192.168.10.6',
|
MASTER_PORT=3306,
|
MASTER_USER='repl',
|
MASTER_PASSWORD='repl',
|
MASTER_USE_GTID=Slave_pos,
|
DO_DOMAIN_IDS=(2);
|
I have a suggestion for this.
In the case of Galera Cluster, there are two GTID domains--gtid_domain_id and wsrep_gtid_domain_id. Only the domain defined by wsrep_gtid_domain_id is used for transactions that are replicated by Galera Cluster. The domain defined by gtid_domain_id is only used for transactions that are local to the node. This means that gtid_domain_id is likely to get out of sync between cluster nodes for all sorts of reasons.
I would suggest updating the documentation, so that DO_DOMAIN_IDS = (<wsrep_gtid_domain_id>) is set in the CHANGE MASTER command.
https://mariadb.com/kb/en/library/change-master-to/#do_domain_ids
However, it looks like MaxScale 2.3.8 doesn't support the DO_DOMAIN_IDS option yet, so it would have to be implemented first. I created
MXS-2581for this.i.e. if wsrep_gtid_domain_id=2, then the command for the primary master would be:
# mysql -h $MAXSCALE_HOST -P $MAXCALE_PORT
MariaDB> SET @@global.gtid_slave_pos='0-198-123';
MariaDB> CHANGE MASTER TO
MASTER_HOST='192.168.10.5',
MASTER_PORT=3306,
MASTER_USER='repl',
MASTER_PASSWORD='repl',
MASTER_USE_GTID=Slave_pos,
DO_DOMAIN_IDS=(2);
And the command for the secondary master would be:
MariaDB> CHANGE MASTER ':2' TO
MASTER_HOST='192.168.10.6',
MASTER_PORT=3306,
MASTER_USER='repl',
MASTER_PASSWORD='repl',
MASTER_USE_GTID=Slave_pos,
DO_DOMAIN_IDS=(2);