2

As it's easier to understand what I'm trying to accomplish with a picture, here's a picture:

enter image description here

I'm really not an expert in database administration, so please be patient.

I am working on a setup where I run three servers with MariaDB 10.0.12 and Galera cluster. I also have a separate installation of MariaDB that I want to run a master/slave setup where the databases gets replicated from each Galera node through keepalived and haproxy for high-availability.

After setting everything up according to a jumble of guides online, I have set up the Galera cluster and servers just fine. However, the replication to my async server doesn't seem to be working very well. Mind you I am also trying to use GTID for all of this using Using_Gtid: Slave_pos. The slave server uses the virtual IP of keepalived to connect to remotely.

Right now I'm getting the following error under the show slave status part of the slave:

Got fatal error 1236 from master when reading data from binary log: 'Could not find GTID state requested by slave in any binlog files. Probably the slave state is too old and required binlog files have been purged.'

This seems to be related to some kind of problem with the slave not being able to sync with the master servers due to the master logs being too high in value (e.g.: mariadb-bin.000080 on the master servers). Could that be the case? And if so, how do I manage to update the slave to understand that it needs to get everything up to the latest?

I really hope someone could help me out with this, or at least show me some way to better solve my current problem.

I was expecting the slave data to be synchronized from the Galera cluster at first connection and the GTID be assigned automatically, but is this is not the case? If so, how do I get the slave up to date?

0

1 Answer 1

2

Galera cluster auto-provisions its nodes, but that is not the case with traditional replication. You must do it manually.

Look at MariaDB documentation for setting up a slave from a backup. The process is essentially the same as doing it in MySQL, but the syntax is slightly incompatible. It usually just involves mysqldump with the --master-data and --gtid options or using Percona Xtrabackup (these methods are handled automatically among Galera nodes).

I also include a link to the MySQL documentation on setting up a new slave because even MariaDB decided to become incompatible with it, the common explanations are way better documented than on the MariaDB wiki (e.g. using mysqldump to backup a server).

3
  • Excellent! That explains at least what I'm trying to achieve. Thanks. However I'm now having an issue with the binary log position on the nodes are not in sync. Number one and two is, but number three is off. The file name is the same, but the position is different. This causes the slave to fail with the message: 'bogus data in log event; the first event 'mariadb-bin.000080' at 663, the last event read from 'mariadb-bin.000080' at 663, the last byte read from 'mariadb-bin.000080' at 682. Any thoughs on that? Jul 23, 2014 at 10:47
  • 1
    After realizing I'm silly I added log-slave-updates and set it to 1 on each node. That made all servers sync their positions and replication worked! Thanks again for your help :) Jul 23, 2014 at 11:53
  • log_slave_updates is required for Galera to act as a master.
    – jynus
    Jul 23, 2014 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.