# Multiple independant clusters

**URL:** <https://forums.percona.com/t/multiple-independant-clusters/38969>\
**Category:** ProxySQL\
**Created:** [August 5, 2025, 12:00pm UTC](https://forums.percona.com/t/multiple-independant-clusters/38969 "2025-08-05T12:00:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [August 5, 2025, 12:00pm UTC](https://forums.percona.com/t/multiple-independant-clusters/38969/1 "2025-08-05T12:00:09Z")

</div>

Hi

I’ve doing an POC on ProxySQL with PXC. So far so good, and for now doing very basic testing this works.

We have multiple independant clusters (having the same kinda of data), lets call them DBC01,DBC02,DBC03 etc.

Is it possible having an single ProxySQL instance (or multiple for failover like ProxySQL Cluster) managing these. I cannot see this done, especially since we need to configure the mysql\_galera\_hostgroups table in ProxySQL.

So the only way I see this is doing, is this true ?  
It is extremely important that the data between the databases are not mixed up, even though the structure is similar in them, but not 100% identical. Some schemas might differ a bit e.g.

ProxySQL1→ DBC01

ProxySQL2→ DBC02

ProxySQL3→ DBC03

And not one to manage them all.  
ProxySQL1→(DBC01,DBC02,DBC03).

---

<div class="post-metadata">

**Author:** ![Abhinav\_Gupta](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/abhinav_gupta/32/6262_2.png) [@Abhinav\_Gupta](https://forums.percona.com/u/Abhinav_Gupta)\
**Post date:** [August 5, 2025, 2:45pm UTC](https://forums.percona.com/t/multiple-independant-clusters/38969/2 "2025-08-05T14:45:51Z")

</div>

> [@lbmdkap](#):
>
> ProxySQL1→ DBC01
> 
> ProxySQL2→ DBC02
> 
> ProxySQL3→ DBC03

This is the correct way to use ProxySQL for your different clusters: keep a separate ProxySQL for a separate PXC cluster configuration and routing traffic.

---

<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 5, 2025, 2:55pm UTC](https://forums.percona.com/t/multiple-independant-clusters/38969/3 "2025-08-05T14:55:54Z")

</div>

@lbmdkap You can use a single proxysql to all 3 clusters. You need to assign different hostgroup ids to each cluster as follows:

DBC01: hostgroup 10 (writer), 11 (reader)

DBC02: hostgroup 20 (writer), 21 (reader)

DBC03: hostgroup 30 (writer), 31 (reader)

Then, add all 9 servers to mysql\_servers table, with proper hostgroup ids. Then add all 3 clusters to mysql\_galera\_hostgroups table, again, using correct hostgroups.

---

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [August 6, 2025, 10:43am UTC](https://forums.percona.com/t/multiple-independant-clusters/38969/4 "2025-08-06T10:43:29Z")

</div>

Thanks. With the current setup/POC we are doing, if we have lets say 30 databases, this would require us to have ~30 instances just of running ProxySQL which is a bit steep. Im aware we can deploy it locally on application servers, but that would potentially for now require us to do too many changes. We might look at this later.

---

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [August 6, 2025, 10:44am UTC](https://forums.percona.com/t/multiple-independant-clusters/38969/5 "2025-08-06T10:44:12Z")

</div>

Interesting. I got an failure when I tried this, and this was why I posted here. But now it worked. Not sure what went wrong, but for sure I was doing something wrong.

Thanks.

---

<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 6, 2025, 1:53pm UTC](https://forums.percona.com/t/multiple-independant-clusters/38969/6 "2025-08-06T13:53:59Z")

</div>

@lbmdkap You might want to also look at query rules based on proxy\_port to further isolate the clusters. Modify `mysql-interfaces` to listen on, for example, 3306, 3307, 3308 and then make rules for each port to route to hg10/11, hg20/21, etc

---

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [August 7, 2025, 7:35am UTC](https://forums.percona.com/t/multiple-independant-clusters/38969/7 "2025-08-07T07:35:23Z")

</div>

Thanks. Yes, that could be an option. 🙂
