Percona XtraDB Cluster: Automatic Failover Between Nodes in Java Spring Boot Application

54 views Asked by At

I've set up a Percona XtraDB Cluster with two nodes, and my Java Spring Boot application is currently communicating with node1. The challenge is that when node1 goes down, the application doesn't seamlessly switch to node2.

Do I need to make specific configurations in my Spring Boot application or the Percona XtraDB Cluster to enable automatic failover?

I want the application to intelligently switch to node2 if node1 becomes unavailable, without manual intervention. Any insights or guidance on the necessary settings or configurations would be highly appreciated.

1

There are 1 answers

0
Marvin Velasquez On

Have you tried to use a proxy front end like ProxySQL or maybe Ha Proxy, the fail over is a process that I think has to be handled on the DB Cluster topology as the cluster is component of the architecture that is aware of the failure (of course the app is also aware that there is no database to connect to, but don´t know that there is another DB in the cluster that can take the request), I don´t have too much experience with XtraDB Cluster but I think it is similar to an InnoDB Cluster in which the cluster setup can perform the automatic fail over in case of a disaster on the leader node.

This Percona how to may be a good starting point.