Search code examples
mysqlbackupperconagalera

Can I run Xtrabackup directly on one of the members in a Galera cluster?


I have a Galera cluster (MySQL) consisting of three nodes and am currently relying on mysqldump for backup. This is cumbersome, to say the least, as the database has grown over the years and is now approaching 20 GiB and mysqldump takes roughly half an hour to do its thing.

Percona xtrabackup seems to be promising and I have tried it out on a copy of the database on a single node with very positive results, where backup time is radically reduced.

What I have not been able to find out is if it is OK to install xtrabackup on one of the nodes (preferably the one running mysqldump today) and run that on the cluster database? I have read quite a lot on xtrabackup but nowhere have I found any information about any risks with running it on one of the cluster members.


Solution

  • I can't think of any risk.

    However, there may be an even faster way...

    Plan A:

    Use a 4th machine to run the backup script. Or, at least, write the dump to a 4th machine. Any dump program is I/O-heavy, probably even I/O-bound. By writing the dump on another machine, you offload the Galera node's I/O.

    I assume you take the node out of the cluster during the backup? And have gcache big enough so that it does an IST, not an SST, to resync?

    Plan B:

    Carrying things a step further, use 4 nodes instead of 3. That way, having a node offline has less impact and less exposure.

    Plan C:

    Use a 4th machine as a Slave to one of the nodes.

    Questions... What is the geographical distribution of the nodes? If all three are currently sitting together, think about tornados, earthquakes, floods, etc.

    What is the purpose of the backup? Will the backup data be geographically remote? (Note: that will add some delay to the backup method.)