0

I have set up an InnoDB cluster with one primary(R/W) and two secondaries (R/O) and bootstrapped a MySQL Router. The router has 2 port 6646(R/W port) and 6647(R/O) port. My application is currently connected to the cluster through the R/W port. Now I am looking for a way to implement load balancing in the cluster. Suppose there are 2 reading requests, how can I route the traffic to a different available database?

l.lijith
9184 gold badges9 silver badges27 bronze badges
asked Nov 25, 2022 at 8:56
2
  • Look in the documentation for "round robin". (It is the only practical method for this situation.) Commented Nov 26, 2022 at 4:50
  • you mean edit the config file of mysql router for the r/w section? Commented Nov 29, 2022 at 1:40

1 Answer 1

0

By default, the Router will load-balance the R/O request in a round-robin fashion.

You can configure the routing strategy to meet your needs, see [basic routing] and [routing_strategy].

answered Dec 8, 2022 at 16:55
2
  • so let say my app is only connecting to the r/w port, there will be no load balancing? suppose there is one node for r/w, two nodes for r/o Commented Dec 10, 2022 at 2:17
  • If your app is only connecting to the R/W port then all traffic will be forwarded to the primary member of the Cluster, always. You won't have any load balancing for R/O traffic. Commented Dec 13, 2022 at 10:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.