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?

2
  • Look in the documentation for "round robin". (It is the only practical method for this situation.)
    – Rick James
    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].

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

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.