How to set up load-balancing with suse?

Hi everyone,

I’m searching for tipps or tutorials to loadbalancing with opensuse.

I have two mysql-servers running as a cluster and now I want to add loadbalancing. The reason for this is, that the two servers are able to receive commands at the same time and synchronize themselves so that they always have the same data. So both can be used of my application-servers.

But the problem is, which IP should I tell the application servers? So I found out that the solution would be the virtual IP of a load-balanced system.

But I only found tutorials for debian and for me, as I’m pretty new to everything, it’s hard to “translate” the debian-tutorials for suse.

Is there any (maybe easy) solution for this?

Thanks in advance,

Yukari

There is no easy solution for this sort of problems.

Firstly, you need to familiarize yourself with LVS.
LVS Documentation

Then, read up more on UltraMonkey, heartbeat and ldirectord.

The ‘easy’ solution I can think of would be ‘Load Sharing with Round Robin DNS’. It’s more quick and dirty than a real solution, because it hits both MySQL servers in turn irrespective of the real load and provides no fallback in case of a failure. It works out pretty well for some scenarios but is useless for others. This would require that you don’t point your application server directly at one of the IP’s but have DNS in between.

My other suggestion is to ask on the MySQL mailing list. There is a bunch of people who have solved your problem.

@syampillai:
Meanwhile I stumbled over some possible solutions. LVS and UltraMonkey where two of them. But I thought I read that UltraMonkey mainly supports Debian and RedHat?
I have no idea how I would install it on suse.
LVS sounds nice, but the documentation is huuuge. But I’ll keep it in mind.

@vodoo:
I already did at one meanwhile. That’s how I heard of UltraMonkey for example. I also have a tutorial for it but I can’t get far… because it’s for debian and that produces lots of problems for me :frowning:
How To Set Up A Load-Balanced MySQL Cluster - Page 5 | HowtoForge - Linux Howtos and Tutorials

What means no fallback?
Maybe it helps if I give some details what I need everything for.
I’ve got two webservers running on a windows loadbalancing-system. On both servers will be moodle and openCMS installed.
There are two database-servers running on opensuse and have mysql as databases clustered via mysql-cluster.

-=welcome Cologne=-

i’m not telling you this is the best this forum can do for you, but
following might give you something to think about until a real
load balancing guru drops into this thread:

have a look here for stuff in our wiki:
http://www.google.com/search?q=site%3Aen.opensuse.org+“load+balancing”

and, then for notes in the forum:
http://www.google.com/search?q=site%3Aforums.opensuse.org+"“load+balancing”

translating from Debian to openSUSE would be real hard for me since
i’ve never used Debian, and the only load i ever tried to balance was
some long lumber, on my shoulder


palladium

Note: Ultramonkey uses LVS and thus, LVS is not a different technology.

Also, I would like to warn you that none of these tools sync your databases if your database is going to be updated by the applications. You can use them only if your web-applications are going to be “read only”.

If you really want a cluster of synchronized databases, the solution is much more complex.

Hi ,

MySQL proxy will do what you are after. It is still in beta, planned for release next year but works very well.

Incidentally, depending on what you are trying to achieve in terms of data reliability, it may be that you only need to setup replication between your mysql servers. This of course is down to how your data is used, how often it is written to, read etc. MySQL replication is very reliable, easy to setup and comes with the product.

Multimaster replication works very well, or you can have master slave relationships ( read/write vs read) with as many slaves as you want. Or combinations of both.

MySQL Cluster is also very reliable and when used with replication can be used to sync geographical clusters. Again it comes out of the box and no fancy hardware is required aside from additional nics for the cluster heartbeats.

Replication would allow you to use a simple round robin DNS load balancing approach or a more complex layer 4 LVS mechanism, which works very well.

MySQL proxy could be a good start though. Many options!!!

hth
J

Ahh,

just reread the op, you state you have a cluster. Do you mean a MySQL cluster or another cluster method ? If the former then binary log replciation is what you need to sync the data between the two nodes. Multimaster replication would be needed if you need to write to both nodes.

Works well and easy to setup.

If you are interested and want to set this up let me know and I will post a config for you.

hth
J

First thank you all for your answers :slight_smile:

Yes, I’m using MySQL-Cluster (this one that you can download from MySQL :: The world’s most popular open source database).
It works fine so far and led me to the idea of the loadbalancing (or to be honest, what led someone else to give me the tipp of loadbalancing xD ).

I already read about both LVS and mysql proxy. I was a little bit afraid of the proxy-solution because of the warning on the mysql-website that it’s “not for production-use”. I thought that’s a pity because it sounded rather easy.
But what I still didn’t understand completely about the proxy… if you use normal load-balancing then you normally have a virtual IP for the NLB-Cluster with all it’s hosts. Is there something similar for the proxy? Because I would need two of them on each machine again. But if I have two again, how do the applications speak to both of them at the same time? (it can’t be only one because then I’ve got the “single-point-of-failure”-problem again)

You would need redundant redirectors and redundant servers for failover protection. But one pair of redirectors can serve multiple services since the work is only on the initial packet.

I’m sorry but I think I hardly understood what you just said :frowning:

You were worried about the redirector being a single point of failure. The answer is simple, make the redirector too a failover pair.

Ah XD yes that is what I just said, that I want a proxy installed on each mysql-machine (so… on both, as I have two of them).

But how do the applications connect to this?

If I had no loadbalancing, proxy or whatever I give the IP of the mysql-server to the application.

If I had a normal loadbalancing I would give the virtual IP to the application.

And if I have two proxies what do I give then to it? That’s what I’m asking for :slight_smile:

You can arrange for balancing/failover for an IP address also. Do you really think that there is only one machine accepting HTTP packets on www.big.company.com?

No. Maybe you don’t understand my questions right… how could I say this more clear… mh

I’m not asking IF it’s possible.

I’m asking HOW it’s possible.

And no… I don’t think that there’s only on machine behind big websites, of course…
That’s why I’m already using a cluster :wink:

My problem is “only” the connection between applications and database-servers :frowning:

You already know the answer, look at the Linux-HA documentation. This forum is too small a space to type in the whole answer. However if you have specific questions about setting up HA, then ask away.

Is it really that difficult? :open_mouth:

And actually… I do NOT know the answer. If so I wouldn’t ask :open_mouth:

At the beginning I thought the proxy would be the easier solution because the default setup looks short in comparison to the huge LVS-dokumentation for example.
My problem was ONLY the addressing of both proxies together. Is this really such a huge problem that nobody can give me a clear answer? :frowning:

But ok… I’ll have a look at the doku you mentioned (…in case I find what you mean ^^" or do you have a link for me?)

It’s the first hit on “linux-ha”.

Each 9 at the end of the uptime percentage adds another level of work.

Ah… on google. Maybe you should have mentioned this :wink: I thought here in the forums or on the suse-website ^^""

Well… I’ll have a look into this as I said.

But I still don’t have any real answer to my original question about the proxy-problem. Only a bunch of clever slogans that don’t really help me.
For example… what is “Each 9 at the end of the uptime percentage adds another level of work.” meant to declare?

It’s not meant angrily, maybe it’s only a misunderstanding because my english isn’t perfect, but at some points of your answers I feel a little bit dispatched…

You will hear phrases in the industry like four 9s availability. This means 99.99% uptime. To get to five 9s, 99.999% requires more work, and then more work again to get to 99.9999%. It may be easier to think of it in terms of downtime. You can find a table here:

High availability - Wikipedia, the free encyclopedia

E.g. four 9s is 52 inutes downtime in a year. That’s not many minutes downtime allowed, but if you are Amazon, then those minutes may mean a lot of sales and customer goodwill. But if you are a school, you probably don’t need that kind of high availability.

So you have to work out how available you want to be, because it costs a lot of effort to add one more 9 to the availability.