LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-18-2010, 11:44 AM   #1
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Rep: Reputation: 30
best way to serve website on two ip address (load balance)


Hey all,

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.
 
Old 01-18-2010, 04:04 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by nephish View Post
Hey all,

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.
 
1 members found this post helpful.
Old 01-18-2010, 04:42 PM   #3
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Original Poster
Rep: Reputation: 30
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.
 
Old 01-18-2010, 07:13 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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/

Good luck any way this goes!

Peace,
JimBass
 
Old 01-18-2010, 08:57 PM   #5
nephish
Member
 
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456

Original Poster
Rep: Reputation: 30
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.
 
Old 01-18-2010, 09:37 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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.

Peace,
JimBass
 
Old 01-19-2010, 09:01 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by nephish View Post
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.

Last edited by TB0ne; 01-19-2010 at 09:02 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
load balance with 2 cpu hosler Linux - General 1 10-13-2009 03:01 PM
Load Balance please Linux - Networking 4 10-28-2008 12:26 AM
Internet load Balance serabut Linux - Networking 1 07-31-2006 02:56 AM
CPU Load Balance - Who knows? davi_cabral Linux - General 3 01-02-2006 03:07 PM
Load Balance with BSD rpaula *BSD 1 03-22-2004 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration