3

I'm looking for some help setting up MySql Replication. I've found quite a few guides and am able to get replication working on two servers, (from what I understand, a master and a slave). But I want my replication to work in such a way that there is a cluster that I can add database servers to on the fly.

I've been looking around online to find a guide that explains how to set this up, but thus far I've not found anything helpful.

This is the guide I used to get the two server replication working: https://www.digitalocean.com/community/tutorials/how-to-set-up-mysql-master-master-replication

If anyone can point me in the direction of a guide that could help me out, I'd be incredibly appreciative. Or if someone more knowledgeable wouldn't mind explaining to me the process that would be great too.

Thanks in advance.

Nathan F.
  • 115

1 Answers1

0

If you are looking for a replication cluster, the Galera cluster library enables multi-master clustering with MySQL: http://galeracluster.com/

Galera allows database servers to join and leave the cluster virtually seamlessly, and uses a quorum setup to handle the failure of one or more active database servers. Of course, a Galera cluster is not invincible, and clustered databases have their own issues. For example, Galera's structure won't scale writes very well.

Severalnines has a good list of tips for running a Galera cluser: http://severalnines.com/blog/9-tips-going-production-galera-cluster-mysql

There are fully MySQL-compatible forks that have built-in Galera support as well, such as MariaDB Galera or Percona XtraDB Cluster. They both work as near drop-in replacements.

Another solution is to use Oracle's MySQL Cluster itself, though the architecture is a bit more complex as MySQL Cluster partitions data across the database servers instead of simply replicating the data to every server. This also means you may have to restructure your data and/or applications, but it allows MySQL Cluster to scale writes. See the MySQL Cluster FAQ to determine if MySQL Cluster is suited for your workload.

edaemon
  • 371