2

I am running MariaDB Galera cluster whose using mariaDB and 3 nodes(node A, node B, node C). My nodes are placed locally in our office.

My problem is if node A/B/C lost network connection, it also lost it's working ability.

Say a application is connected to node A, then node A lost network connectivity, so when someone tries to read/write data on node A using physical access,say CLI, it doesn't work. It's showing, ERROR 1047 WSREP has not yet prepared node for application use

I want to use node A/B/C offline as well. When they get back the network connection, it will automatically replicate offline data to the connected nodes.

Thanks in advance,

Nixon

1
  • I added a comment to my answer which may or may not be helpful. – dbdemon Dec 5 '17 at 8:27
0

Galera can't do that, unfortunately, although you can configure it to handle shorter network outages. (See Galera's config tips for WAN replication.) Nodes have to be connected for Galera's global ordering to work so that it can merge writes from multiple nodes. See e.g. here

Maybe what your application could do instead if a node loses network and becomes unavailable (which could be detected by the application or a DB proxy) is to automatically fail over to a different cluster node. However, that still requires network connectivity to this other node.

So if your architecture needs to be tolerant against network losses between nodes, then you may have to look for a different solution.

1
  • This is speculation as I don't have experience with this, but if you can detect network loss (e.g. by catching the exception / error from MariaDB) then you could detach the node from the cluster (I'm guessing wsrep_on=OFF and wsrep_cluster_address='') and put the node in read-only mode (read_only=ON) until network is restored and you put those variables back to their original values. Then you can queue writes in a messaging system (ActiveMQ, ZeroMQ, RabbitMQ etc) and apply the writes once the network has come back. – dbdemon Dec 5 '17 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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