E
E
elisey4742017-08-06 13:02:14
linux
elisey474, 2017-08-06 13:02:14

How to make a MySQL cluster?

There are two servers. You need to do the following:
1) On each server, upon request to localhost:3306, there was access to the mysql server - a member of the cluster.
2) Each member of the cluster could join it after the system booted at any time.
3) If a cluster member leaves it, then after he reconnects, he will be able to get the current database from other cluster members.
4) If a cluster member responds for too long, then it will not affect the performance of other members.
5) If both cluster members start writing to the same cell, then requests will be processed one after the other without conflicts.
As far as I understand, the only true-way is Galera MySQL Cluster. Are there any other options?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fixid, 2017-08-06
@elisey474

Alternative
Only this is a more serious solution, it is difficult to set up without experience.
But it's been running for two years without a hitch.
I did not notice that there are two servers, this option will not be reliable.
If you have two machines, then you need a banal master-master. But at the code level, always write to only one of them and only switch if it is unavailable. This also applies to Galera Cluster

V
vlarkanov, 2017-08-08
@vlarkanov

MariaDB (fully compatible with MySQL) + Galera cluster. Two nodes is very bad, you need to add an arbitrator. This is a weak machine that lives in a quorum-only cluster. Enough of a dead virtual machine 1 core, 1 gig of Oprah, 5GB of hard.
About point 4, I'm not sure if it's real in principle. Cluster means that the speed of the cluster is equal to the speed of the slowest machine, sad but true.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question