I am trying to setup a master-slave replication with galera-cluster (choose 1 node as the primary master) and a standalone mariadb server (slave).
I have successfully setup the replication and data is in sync.
However, when I check the gtid_binlog_pos
from the slave node, it is showing 0-1-2
(primary master's binlog pos) and 99-2-2
(slave itself's binlog pos).
Is this normal and what does it mean?
MariaDB [testdb]> show variables like 'gtid%';
+-------------------------+--------------+
| Variable_name | Value |
+-------------------------+--------------+
| gtid_binlog_pos | 0-1-2,99-2-2 |
| gtid_binlog_state | 0-1-2,99-2-2 |
| gtid_cleanup_batch_size | 64 |
| gtid_current_pos | 0-1-2,99-2-2 |
| gtid_domain_id | 99 |
| gtid_ignore_duplicates | OFF |
| gtid_pos_auto_engines | |
| gtid_seq_no | 0 |
| gtid_slave_pos | 0-1-2 |
| gtid_strict_mode | OFF |
+-------------------------+--------------+
And here is my configuration files:
primary master /etc/my.cnf.d/replication.cnf
:
[mysqld]
# Galera node as master
wsrep_gtid_mode = on
wsrep_gtid_domain_id = 0
server-id = 01
log_slave_updates = on
relay-log-index = /var/log/mysql/gmariadb01-relay-bin.index
relay-log = /var/log/mysql/gmariadb01-relay-bin
gtid_domain_id = 1
log-bin = /var/log/mysql/gmariadb01-bin
log-bin-index = /var/log/mysql/gmariadb01-bin.index
binlog_format = ROW
log_error = /var/log/mysql/mariadb.err
replicate-do-db = testdb
slave /etc/my.cnf.d/replication.cnf
:
[mysqld]
#Replication slave to Galera Cluster
server-id = 02
log_slave_updates = on
relay-log-index = /var/log/mysql/gmariadb03-relay-bin.index
relay-log = /var/log/mysql/gmariadb03-relay-bin
gtid_domain_id = 99
log-bin = /var/log/mysql/gmariadb03-bin
log-bin-index = /var/log/mysql/gmariadb03-bin.index
binlog_format = ROW
log_error = /var/log/mysql/mariadb.err
replicate-do-db = testdb