Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

So, 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 (i.ex: 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.

share|improve this question
    
How exactly do you initialize your slave data and provide it with an initial GTID? –  jynus Jul 22 at 15:11
    
I was actually expecting the data to be synchronized from the galera cluster at first connection and the GTID be assigned automatically, but I feel in your response that this is not the case? If so, how do I get the slave up to date? –  Johnny Antonsen Jul 23 at 7:45

2 Answers 2

up vote 0 down vote accepted

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).

share|improve this answer
    
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? –  Johnny Antonsen Jul 23 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 :) –  Johnny Antonsen Jul 23 at 11:53
    
log_slave_updates is required for Galera to act as a master. –  jynus Jul 23 at 13:22

I recently experimented around with this. We call this Channel fail-over. Maybe the article helps you:

http://www.fromdual.com/replication-channel-fail-over-with-galera-cluster-for-mysql

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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