MariadB Galera: Attaching an asynchronous Slave using GTID

Galera the synchronous Master-Master replication is quite popular.
It is used by Percona XtraDB Cluster, MariaDB Galera Cluster and even patched MySQL binaries exist.
Quite often you want to add a slave to a Galera Cluster. This is going to work quite well.
All you need is at least configure log_bin, log_slave_updates and server_id on the designated Masters
and attach your Slave.

GTID@MariaDB

Even you can use traditional (non GTID) replication. Using non GTID replication is a hassle.
As you need to search for the right offset on the new Master to attach your Slave on.

Using GTID promises to be easier. As you simply switch to the new Master and
the replication framework finds the new position based on the GTiD automatically.

As a fact we have two GTID implementations

GTID@MySQL/Percona

GTID@MariaDB

There are already blogpost about attaching a Slave to a Galera Cluster not using GTID.

In opposite to the blog please use wsrep_sst_method=xtrabackup-v2.
The current MariaDB release 10.0.12-MariaDB-1~trusty-wsrep-log has a bug preventing
you to use wsrep_sst_method=rsync

Additional Configuration on the Galera nodes

[mysqld]
log_bin
log_slave_updates
server_id = 1

log_bin activates the binlog, while log_slave_updates make sure to write all transactions replicated via Galera into that binlog.
On didactic purpose we set the server_id on the same value on all Galera nodes.

Configuring the Slave

[mysqld]
binlog_format = ROW
log_bin
log_slave_updates
server_id = 2

GTID@Mariadb still lacks good operational integration.
So building a slave is done not using GTID.