# The topology design of XtraDB cluster 8.0.19

**URL:** <https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870>\
**Category:** Percona XtraDB Cluster 8.x\
**Tags:** community, mysql, percona\
**Created:** [August 8, 2020, 9:17am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870 "2020-08-08T09:17:02Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 8, 2020, 9:17am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/1 "2020-08-08T09:17:02Z")

</div>

hi,  
any doc about the suggested topology design on XtraDB cluster 8.0.19 ?  
it has to include what is the best global variable suggest those structure and design.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 9, 2020, 6:24am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/2 "2020-08-09T06:24:12Z")

</div>

like why 2 x nodes is not better than 3x nodes for percona xtraDB cluster.  
  
in the Percona XtraDB Cluster Documentation Release 8.0.19-10 it said:  
  
“A cluster consists of nodes, where each node contains the same set of data synchronized accross nodes. The recommendedconfiguration is to have at least 3 nodes, but you can have 2 nodes as well”  
&nbsp; &nbsp;why 2 nodes is ok ? what about 2x nodes on primary site and 2x nodes on DR site? will it be possible to failover ? node majority usually recommend 3 nodes to avoid split brain by using odd number of nodes.  
  
in MariaDB Galera cluster, they do not allow even number like us, 2 x in primary and other 2x in DR site ! e.g. once&nbsp; primary site down, DR site down too to present insyn between both site (split brain).  
  
please show me any doc with diagram which say 3 nodes is better than 2. and usually how many node suggested in primary site and how many in DR site. tks.  
  
&nbsp;AFAIK, no open source DB platform can do cross site failover, please confirm with me if percona xtraDB cluster is the only one can do this ! the Percona XtraDB Cluster Documentation Release 8.0.19-10 say sth like cross site but I am not sure how it cross site?&nbsp; by 2 x different xtraDB cluster on different site and replication is setup between them?&nbsp;

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 20, 2020, 5:41am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/3 "2020-08-20T05:41:46Z")

</div>

any answer ? we only have 2 x data centers and I am not sure if 3 x nodes in primary DB and 2 x nodes in DR site is a good design based on nodes majority.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 20, 2020, 8:43am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/4 "2020-08-20T08:43:36Z")

</div>

The documentation says you _can_ have a 2-node cluster. It is not recommended to have a 2-node cluster but you can do it. You can also have a 1-node cluster. The recommendation is 3 to avoid split-brain, or single server failure situations.  
PXC should have an odd number of members, 3 or 5, to avoid split-brain issues. Your DR setup is up to you. You can have a 3-node PXC in primary DC with another 3-node PXC in your DR, and use async-replication to keep DR in sync. Or you can have just a single MySQL server acting as async replica in DR.  
Correct, you would need some external tool to manage failover such as Orchestrator or ProxySQL.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 20, 2020, 9:30am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/5 "2020-08-20T09:30:41Z")

</div>

“The documentation says you can have a 2-node cluster. It is not recommended to have a 2-node cluster but you can do it. You can also have a 1-node cluster. The recommendation is 3 to avoid split-brain, or single server failure situations.”  
yes I knwe, I will have 3 nodes cluster on primary site.  
“You can have a 3-node PXC in primary DC with another 3-node PXC in your DR,”  
then it is not an odd number in total , it is 6, right ? how about 3 nodes in primary and 2 x nodes in DR ? can they work together as cluster?  
  
"and use async-replication to keep DR in sync. "  
  
yes, BTW, any document to show me how to set this configuration up ?&nbsp;  
  
“Or you can have just a single MySQL server acting as async replica in DR.”  
1 x nodes in DR&nbsp; and 3 x nodes in primary still ok ? it is even number , 4 , in total , is not an odd number anymore!  
  
“Correct, you would need some external tool to manage failover such as Orchestrator or ProxySQL.”  
so actually PXC will not failover by itself ?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 20, 2020, 9:57am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/6 "2020-08-20T09:57:46Z")

</div>

You need to pay attention to my words.  
\>&nbsp;You can have a 3-node PXC in primary DC with another 3-node PXC in your DR  
That is NOT 6 nodes. That is 2 INDEPENDENT clusters of 3 nodes each using async replication between them.  
You&nbsp;_can_ create 1 cluster of 5 nodes between two datacenters (3 in DC1, 2 in DC2) but this is not good practice because commit times will be slow due to synchronous WAN replication.  
  
\>&nbsp;yes, BTW, any document to show me how to set this configuration up ?&nbsp;  
This is a standard setup. If you can set up async replication, you can set this up. Plenty of google-searches.  
  
\>&nbsp;1 x nodes in DR&nbsp; and 3 x nodes in primary still ok ? it is even number , 4 , in total , is not an odd number anymore!  
You need to understand the _difference_ between a plain MySQL node and a cluster node. That is NOT 4 nodes. That is 1 cluster of 3&nbsp;_nodes_ and 1 async MySQL server. The async server is NOT a node/member of the cluster.  
  
\>&nbsp;so actually PXC will not failover by itself  
If node 1 goes down, nodes 2 and 3 will remain online and the cluster will be online. BUT, there is nothing to manage your application traffic to reroute connections to the other nodes.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 20, 2020, 11:36am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/7 "2020-08-20T11:36:41Z")

</div>

“You&nbsp;can&nbsp;create 1 cluster of 5 nodes between two datacenters (3 in DC1, 2 in DC2) but this is not good practice because commit times will be slow due to synchronous WAN replication.”  
so single cluster , replication between nodes can only be sync mode?  
so across DC can only have 2 x cluster with diff cluster name and the replication between 2 x cluster can ONLY be async mode?  
“If node 1 goes down, nodes 2 and 3 will remain online and the cluster will be online.”  
the same cluster , right ?&nbsp;&nbsp;  
so the proxysQL is just like maxscale for mariaDB or mysql router for Mysql ?  
and there are no failover between nodes at all within the same cluster, right&nbsp; ? can proxySQL helps to router to differnet cluster in DR site , which carry the same data set ?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 20, 2020, 12:13pm UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/8 "2020-08-20T12:13:53Z")

</div>

\>&nbsp;&nbsp;so single cluster , replication between nodes can only be sync mode?  
Correct. PXC/Galera is synchronous replication only between nodes.&nbsp; PXC–\>MySQL as Source/Replica is async.  
  
\>&nbsp;so across DC can only have 2 x cluster with diff cluster name and the replication between 2 x cluster can ONLY be async mode?  
Correct. With 2 independent/different clusters, you can only do async.  
  
\>\>&nbsp;“If node 1 goes down, nodes 2 and 3 will remain online and the cluster will be online.”  
\> the same cluster , right ?  
Correct  
  
\>so the proxysQL is just like maxscale for mariaDB or mysql router for Mysql ?  
ProxySQL is far more powerful and feature-rich  
  
\>&nbsp;and there are no failover between nodes at all within the same cluster, right?  
Correct  
  
\> can proxySQL helps to router to differnet cluster in DR site , which carry the same data set ?  
Yes

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 21, 2020, 2:14am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/9 "2020-08-21T02:14:37Z")

</div>

"&nbsp;PXC–\>MySQL as Source/Replica is async.“  
PXC and MySQL mostly the same, right ? so not only PXC to -\> MySQL but also PXC to PXC ? I don’t understand this.  
”\> can proxySQL helps to router to differnet cluster in DR site , which carry the same data set ?  
Yes＂  
So ProxySQL only need to know remote PXC ip address? e.g. 3 x nodes in remote data center, 3 x IP in remote DC and we just need to add to proxySQL ?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 21, 2020, 8:33am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/10 "2020-08-21T08:33:23Z")

</div>

\>&nbsp;PXC and MySQL mostly the same, right ? so not only PXC to -\> MySQL but also PXC to PXC ? I don’t understand this.  
PXC&nbsp;_is **&nbsp;** _MySQL with additional clustering technology (Galera). Yes, you can replicate using standard asynchronous replication from PXC to MySQL. “MySQL” does not speak Galera. PXC and MySQL both speak MySQL async protocol. Yes, you can replicate using asynchronous replication from PXC A&nbsp; to PXC B.  
  
\>&nbsp;So ProxySQL only need to know remote PXC ip address? e.g. 3 x nodes in remote data center, 3 x IP in remote DC and we just need to add to proxySQL ?Yes, you must correctly configure ProxySQL to make failover work correctly.

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 28, 2020, 2:06am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/11 "2020-08-28T02:06:50Z")

</div>

is there any topology diagram in any URL show out this DR concept of PXC ?  
"&nbsp;“MySQL” does not speak Galera. PXC and MySQL both speak MySQL async protocol."  
do you mean galera replication only between nodes in the same cluster on the same site, and MySQL async protocol only across site?  
so Galera replication can’t across sites anyway?  
please help on this too:  
[https://forums.percona.com/discussion/56033/about-pmm-standalone-installation#latest](https://forums.percona.com/discussion/56033/about-pmm-standalone-installation#latest "Link: https://forums.percona.com/discussion/56033/about-pmm-standalone-installation#latest")

---

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 28, 2020, 2:18am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/12 "2020-08-28T02:18:22Z")

</div>

hi,  
sorry, I reread this :&nbsp;  
“You&nbsp;can&nbsp;create 1 cluster of 5 nodes between two datacenters (3 in DC1, 2 in DC2) but this is not good practice because commit times will be slow due to synchronous WAN replication.”  
so this still means to me that the SAME PXC can across site? but it just slow as sync across a long distance is not working very well?  
What if we have a very good connection between sites so that sync lagging is not noticeable ?  
any signal from PXC to tell us the network between 2 x sites is not good and we have to consider to create 2 x clusters and must setup async replication between sites?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 28, 2020, 9:01am UTC](https://forums.percona.com/t/the-topology-design-of-xtradb-cluster-8-0-19/7870/13 "2020-08-28T09:01:01Z")

</div>

\>&nbsp;so this still means to me that the SAME PXC can across site?  
Yes. You can put PXC nodes&nbsp;_anywhere in the world_ and create a synchronous cluster, but you’ll be limited by the lag/latency for commit times.  
  
\>&nbsp;any signal from PXC to tell us the network between 2 x sites is not good  
SHOW GLOBAL STATUS LIKE ‘wsrep\_evs\_repl\_latency’ shows you the lag between nodes in your cluster.  
  
\>&nbsp;and we have to consider to create 2 x clusters and must setup async replication  
That is 100% your decision. If 2s of latency is OK with you, then you don’t need to setup async. However, if 0.5s of latency is too high for you, then you’ll have to setup async. The decision is yours.
