[ClusterLabs] MariaDB master-slave with Semi-Synchronous & GTID

Nils Carlson nils.carlson at ludd.ltu.se
Sun Feb 12 18:33:27 EST 2017


On 02/11/2017 02:42 PM, Nils Carlson wrote:

> Hi,
>
> I am looking into setting up MariaDB with semi-synchronous replication 
> and GTID. I am wondering if anyone has experience with this setup?
>
> The mysql resource-agent doesn't seem to deal with either GTID or 
> semi-synchronous replication, but might work anyway as these can 
> probably be set up outside the resource agent from what I can see. But 
> all help, pointers and experiences most welcome.
>
Answering myself, I tried the mysql resource agent, and it didn't work 
out of the box.
Looking through it I realised it was trying to do far more things than 
are needed with a modern MariaDB
setup. I took the time to write a new resource agent based on the mysql one:

https://github.com/pyssling/resource-agents/blob/master/heartbeat/mariadb

With instructions here:

https://github.com/pyssling/resource-agents/blob/master/heartbeat/README.mariadb.md

More cleanup seems possible and also improvements. Using global 
transaction IDs we should be able to detect, when starting the cluster, 
which slave is most up-to-date and use this one as master. We could also 
probably start replicating in a pre-notify instead of a post-notify.

I haven't tested this with synchronous replication yet.

/Nils





More information about the Users mailing list