Andy
Andy

Reputation: 727

MySQL Cluster Load Balancing across multiple Slaves

I'm in the process of creating a MSSS mysql setup is there a way to load balance the Slaves so that the web box simply asks for a slave connection and one is given to it that isnt being hammered.

my current plan, which isnt ideal, is to do a round robin random approach for each connection. The issue i have though, is what if one of the Slaves breaks, i am unsure how to remove this from rotation.

I'm wondering if others have created a cluster like this and how they manage/maintain it. as i'm a bit clueless.

Upvotes: 0

Views: 100

Answers (1)

symcbean
symcbean

Reputation: 48357

I'm about to vote to close this as too broad but I'll give you some pointers (using an answer as a comment doesn't provide much space).

Managing clusters is hard.

Have a look at HAProxy and mysqlproxy, both of which are capable of doing this - the trick is planning how your cluster should behave -

Should server state be shared across clients - so if one client fails to connect none will try the server again. How do you deal with 'Too many connections'?

Are you trying to improve availability as well as performance? (single points of failure, preconfiguring one of the slaves as a master but directing writes to the designated master)

Will you have a requirement to fence nodes?

Is asynchronous replication a requirement? (compared with semi-synch or multi-master)

How do you direct writes to the master?

Upvotes: 1

Related Questions