1

I am a fresh about PXC. I wonder if I can deploy a cluster across three datacenters. For example:

  • Node A in data center 1
  • Node B in data center 2
  • Node C in data center 3

The latency between data center 1 and data center 2 is low because they are in the same city. Data center 3 is far away from them.

  • A and B both provide write and read
  • C only a full backup and vote to A or B to decide which one is the donater which never provide write or read.

  • A synchronizes with B

  • C asynchronize with A and B.

And the donater only be A or B. How can I configure it in this way?

lloydpick
  • 1,638
  • 1
  • 18
  • 24
xinxu wang
  • 11
  • 2

1 Answers1

1

You can deploy PXC across 3 data centers like this. However, you cannot configure Percona XtraDB Cluster (or generic Galera) behavior in this way.

All members of a cluster work together. All WRITE transactions will be sent to all nodes and must be acknowledged by all nodes (ie: certification). The fastest your cluster can write is the RTT of the slowest node, in this case C.

You can configure A and B to be donors of each other in case one of them goes down. (my.cnf: wsrep-sst-donor)

You may be confusing some terms. "donor" is a state when a node is sending a copy of the data (IST/SST) to another node. If your cluster is in Primary state, there is no "donation" happening. Are you thinking about leader election? That doesn't exist in PXC. Only simple quorum exists. Any node can read and any node can write at any time; there are no restrictions on this unless you manually set read_only=1 within MySQL.

What you could do is deploy a 3-node PXC with DC1: A, B, DC2: C, and in DC3: D, use MySQL async replication as an off-site backup. You would have to pick one of A, B, C to be the "master" for async replication (be sure to setup GTIDs). In this setup, D would not be part of PXC and would not participate in certification and not participate in quorum; it would function as backup only.

3-node PXC with ASYNC-Slave

utdrmac
  • 731
  • 5
  • 17