> In fact, my MySQL and apache server aren't the
> same server. I have an apache cluster which is
> working with LVS clustering system. And I wonder
> if I can use lvs to do an other cluster with only
> MySQL server.
I don't think you can. But I also don't see why you would want to.
> Finally a PHP scripts could tell the MySQL
> loadbalancer and the loadbalancer redirect the
> mysql query to the mysql server which works the
> least.
If you control your own DNS, you can do this easilly. First, set up say three SQL nodes.
Then, add thee A records mysql.domain.tld for the three IP addresses for the above three SQL nodes.
Then point your PHP scripts to connect to "mysql.domain.com" and you will get a fairly rough 33% each distribution of content.
Of course I would still do it by installing MySQL on each machine in your LVS cluster and having the scripts connect from localhost. (this solution allows you to remove dead MySQL SQL nodes from the pool).
> I think it's possible but I would like some
> opinion of this solution and if it's performant
Well to be honest you are unlikely to have any performance gain (unless you have an enormous load on your MySQL servers) and without any form of failover in my view it is fairly pointless but I can think of easy and cheap ways of doing this with failover. Email me if you need some more ideas.
Alex
Alex Davies
http://www.davz.net |
alex@davz.net