0

I setup galera cluster on two different server and sync them as a master-master replication.

SERVER CONFIGURATION

Debian GNU/Linux 7 500 GB HDD

Lets say example i have two servers. Server A and Server B

ISSUE

Now due to some reason if server A Mysql crashed or Server Down that time complete traffic managed by Server B and it log data on B server A and server B are in master-master replication so both node are masters.

Now the problem is when A was down and the data which inserted on B that's replicate on A completely fine when A is UP but the data is not sync which perform update operation on B in absence of A.

Does anyone have any idea why this is happening or is there any configuration that resolved my issue?

Thanks in advance.

H.Patel
  • 1
  • 1

1 Answers1

1

This is a typical split-brain scenario.

What is happening is that your cluster can not determine which one is the primary node. You can read more about it here.

To prevent this from happening in the future you should make sure that you have a uneven number of nodes in your cluster, or use a Galera Arbitrator.

I hope this was helpful. Good luck!

mrb
  • 68
  • 1
  • 8
  • @mrb we are having 2 servers in the replication(even number), do you mean we need to add some dummy server to avoid this issue again? is this issue common? – Devang Mar 27 '17 at 07:15
  • @Devang. The problem with even numbers is that they cannot determine which of the two servers is the 'primary' node after a node failure. Adding a third node to the cluster can solve this. You can find all the information here: http://galeracluster.com/documentation-webpages/twonode.html. – mrb Mar 27 '17 at 20:51
  • @Devang, yes the problem is very common because your application is very dependent on the network. And we all know that a network is not 100% reliable. You could read the CAP Theorem of Dr Eric Brewer if you want to know more about it. :) – mrb Mar 27 '17 at 20:54
  • @H.Patel I know that Server A is your primary node. But Server A and Server B cannot determine after a crash which one of them has latest version of the data and therefore they cannot decide which one is the primary component. By adding a Galera Arbitrator or a third node you can solve this problem. They just need some 3rd party helping them out with the vote (quorum calculation). – mrb Mar 27 '17 at 21:01
  • 1
    Maybe this explains the split-brain and quorum calculations a bit better: http://galeracluster.com/documentation-webpages/weightedquorum.html. – mrb Mar 27 '17 at 21:08