Mysql And Galera cluster mariaDB , Private and Public IP Addresses multisite

galeramariadbMySQL

I am just wondering has anyone come accross this before and the best method to go about doing it.

We have a customer that wants multi site replication over a galera cluster.

I am familiar with setting this up but not in the way they are asking for.

First of all the client has a dedicated L2 connection between the datacentres so I have set up the cluster with Private IP addresses going across the dedicated L2 link, the issue is if the L2 link goes down they loose the replication between sites, So I was thinking of natting the nodes private IP addresses to Public IPs.

My question is: Is there a way I can set the galera cluster so that if it cant reach the private IPs it will go out over the internet through the firewall and hit the public IPs?

Could I maybe put the private and public IPs of each site within this setting:

wsrep_cluster_address=gcomm://server1private_IP1,server1public_IP1,server2private_IP1,server2public_ip1 etc

Saying that server1 is local in my datacentre and server2 is in another datacentre.

Or would that write the data twice over the 2 links?

Thanks in advance for any help that is thrown my way.

Best Answer

Maybe you can reach what you want changing gcomm ip addresses to custom non-FQDN hostnames (db1, db2, dbN). Then you can play a little bit with DNS resolution just updating your hosts file on each db node. This is not official nor valuable solution anyway ;)