Not the answer you need?
Register and ask your own question!

Master-Master synchronization between clusters across WAN using PXC 5.6

nublaiinublaii EntrantCurrent User Role Beginner
I'm trying to set up a single cluster spread in two datacenter, US and EU, and right now this is what I have:

EU:
mysql-eu01

US:
mysql-us01
mysql-us02

I have defined 2 regions using wsrep_provider_options="gmcast.segment=1" for EU and wsrep_provider_options="gmcast.segment=2" for US.

I have a big question I can't quite figure out: I want all the servers to behave like masters (writes synchronize to all other servers).

Do I need all servers to be able to connect directly to each other (ports 3306, 4444, 4567 and 4568)? Or can I get away with using wsrep_sst_donor? In this particular example, do I need to give mysql-eu01 access to mysql-us02?

mysql-eu01:
[mysqld]
...
server_id=1
wsrep_cluster_address=gcomm://mysql-eu01,mysql-us01,mysql-us02
wsrep_node_address=mysql-eu01
wsrep_provider_options="gmcast.segment=1"
wsrep_node_incoming_address=mysql-eu01
wsrep_sst_donor=mysql-us01
...

mysql-us01:
[mysqld]
...
server_id=3
wsrep_cluster_address=gcomm://mysql-eu01,mysql-us01,mysql-us02
wsrep_node_address=mysql-us01
wsrep_provider_options="gmcast.segment=2"
wsrep_node_incoming_address=mysql-us01
wsrep_sst_donor=mysql-eu01
...

mysql-us02:
[mysqld]
...
server_id=4
wsrep_cluster_address=gcomm://mysql-eu01,mysql-us01,mysql-us02
wsrep_node_address=mysql-us02
wsrep_provider_options="gmcast.segment=2"
wsrep_node_incoming_address=mysql-us02
wsrep_sst_donor=mysql-us01
...

All servers are behind firewalls with no external IP, and I would have to map each one of them. I plan on adding more servers to the equation, so I would prefer to no have to map ports for each one of them.

Comments

  • przemekprzemek Percona Support Engineer Percona Staff Role
    Usually the simplest way to connect properly nodes in different WAN locations, without using external IPs, is to join them via VPN.
    Otherwise, you can try with port redirects but IMHO it will be more complicated. If you establish connection only between mysql-eu01 and mysql-us01, the mysql-us02 may still work using message relaying via mysql-us01. But if the rely host goes down - whole cluster goes down.
    So I recommend having network connection between each node in the cluster, regardless of using segments.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.