Realservers as client

Leon Botes leon at trusc.net
Wed Jan 31 07:20:15 GMT 2007



Kenny Dail wrote:
>>
>> Joseph Mack NA3T wrote:
>>> On Mon, 29 Jan 2007, Leon Botes wrote:
>>>
>>>> Can anyone suggest a solution or at least show me the flaws in this 
>>>> sort of setup. I desperately need to balance the mysql services with 
>>>> the real servers as clients.
>>> since the users initial connection to the realserver is balanced, why 
>>> can't you let the realserver connect directly
>>> to the database? You don't need to balance again.
>>>
>> The mysql service is depended upon by all the real servers for many 
>> different applications. The load placed on one mysql server by all the 
>> real servers cumulatively would be rather high and the potential loss 
>> involved in loosing database records could be very high. For that reason 
>> i need to provide mysql failover as well as load balancing.
> 
> Perhaps using MySQL's Cluster option would be prudent.
> http://www.howtoforge.com/loadbalanced_mysql_cluster_debian
> 
The mysqls are running the ndb cluster already. What i was looking for 
is to load balance the requests to the mysqld servers from a single 
virtual ip address run by heartbeat and balanced by ldirectors to the 
realservers. The realservers all run the application that queries the 
mysqld's via the virtual ip so they ended up always asking themselves 
for the result since i have setup LVS-DR with the virtual ip aliases to 
lo interface.
Eventually is got a workaround only because i am fortunate enough to 
have 4 relaservers so here it is for anyone interested:
Director has 2 nics. Connect 2 servers to each side of the director. 
Call them pool A and pool B.
Pool A looks a the VIP on pool B side which ldirector balances between 
the pool B realservers.
Pool B looks a the VIP on pool A side which ldirector balances between 
the pool A realservers.
My clients connect to the network on pool A side so pool A is configured 
as GATE and pool B as MASQ. No there is no actual masquerading done by 
any iptables rules.
Using the MYSQL cluster provided with mysql 5.0 it automatically 
syncronises the data between all realservers.
Its not the ideal situation of having 4 load balanced mysql realservers 
since you end up only balancing to 2 from any one realserver but at 
least i get load balancing and failover. As the load increases i will 
just have tp add more realservers until someone comes up with a solution.
Remeber my realservers are FreeBSD so i couldn'y apply any of the linux 
patches on 
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-DR.html#realserver_as_client_in_LVS-DR

Hope it helps anyone having a similar problem.

Leon

Search lvs-users Archives
Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort

More information about the lvs-users mailing list