best way to serve website on two ip address (load balance)
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We have a server that needs to be hi availablility.
The problem is, sometimes our internet winks out for a few minutes.
We decided that we wanted to get two seperate lines to our server, and so they would be two different ip addresses.
What out there would allow us to serve apache on www.mywebsite.com on more than one ip, and, if we can, do load ballancing?
thanks for any tips, this part is all new to me.
Well, if you're talking about ONE server with TWO NIC's in it...what's the point? You've still got several single points of failure (power supply, hard drives, apache, etc.), the failure of any would easily take down your server. And if it's a single server, 'load balancing' isn't done...since ALL your requests are going to ONE box anyway. Channel-bonding will let you do some things like this, though...
If you're already saturating a gig-e line with traffic, having more than one server is obviously better. At that point, you can either use something like a Radware box, which is a dedicated hardware-based solution. It'll do round-robin, next session, or bandwidth-based switching between several servers, and all of them go to one 'virtual' IP address. So the one IP on the Radware box is outward facing, and is the one you'd have a DNS entry for. Your two/more servers connected to radware internally, each have their own NIC and address, and are set up as part of the 'farm'. It's by far the best way to go, and is scalable, too. You can start with two servers, and go up from there as traffic demands.
Thanks a lot.
Now looking into the Radware box as a clean alternative to me messing with config files in a homemade solution till i break my head.
Appreciate your help.
I don't disagree with anything TB0ne said, particularly the parts about one server being a major single point of failure. Having 2 NICs and 2 internet connections are great, but you still would have a solitary server running the whole show. Any OS/mechanical/misconfiguration and the entire site is crashed, even if you had 100 distinct internet connections.
I don't know the Radware gear personally, but my perception is that hardware based load balancing is costly, often 5 figures costly. The Radware box may be $999, but I would expect it to be very much more expensive. Realistically, it doesn't do anything that you can't do with a few scripts and the linux high-availability app. Yes it would mean configuration and learning new things, but I suspect that makes you a better sysadmin in the long run. Don't get me wrong, if your company has money to throw at hardware, take advantage of it, but I suggest learning how to home-cook a setup of your own. The high-availability website is http://www.linux-ha.org/
Thanks a lot, will look into a more DIY solution before buying anything.
The thing about the single server is...
my employer wants two servers, one just acting as a backup. It will have all the same services and programs, just only running a slave replication on the database. If the main server dies, the backup will be a drop in replacement.
Don't know if i like it or not. Seems we could do better by employing them both. but still...
There's a couple of things to consider with a database. How much data changes in it, how frequent are the changes, and what happens if a change happens to one copy of the database, but not the other.
A hot spare server can be cool, but it also seems like somewhat of a wasted box then.
Personally, I'd run linux-ha with both apache and the database (mysql/oracle/whatever) mirrored between them, and run both all the time. If you want to get fancier, set up two clusters, one for databases and the other for apache. Ideally, they'd be in separate locations, IE two different data centers, but if they are in one office, set it up so that there is no single point of failure (2 switches, 2 firewalls, so forth and so on).
It comes down to what hardware you have available, what your boss is willing to buy, and how important the data is.
Thanks a lot, will look into a more DIY solution before buying anything.
The thing about the single server is...
my employer wants two servers, one just acting as a backup. It will have all the same services and programs, just only running a slave replication on the database. If the main server dies, the backup will be a drop in replacement.
Don't know if i like it or not. Seems we could do better by employing them both. but still...
thanks again all.
Well, as JimBass said....Radware CAN be pricey, but it does bring alot to the table, too.
However, given this new info (one server 'hot', the other 'idle'), I'd definitely go with the heartbeat and scripting solution, especially if you're running MySQL in replication mode.
If you're not saturating your network pipe, and you're not maxing out your server resources, spending wads of cash is overkill.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.