nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

how to do Apache Load Balancing and clustering

This is a discussion on how to do Apache Load Balancing and clustering within the Web servers forums, part of the Mastering Servers category; Hello Nixcraft fans This is Manish.Well I want configure apache as a load balancing server on 7 servers .So if ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-06-2007, 10:22 PM
Junior Member
User
 
Join Date: Jun 2007
My distro: Centos & Freebsd
Posts: 15
Rep Power: 0
manish_2479 is on a distinguished road
Send a message via AIM to manish_2479 Send a message via MSN to manish_2479 Send a message via Yahoo to manish_2479
Default how to do Apache Load Balancing and clustering

Hello
Nixcraft fans

This is Manish.Well I want configure apache as a load balancing server on 7 servers .So if one server fails the load will be shared by rest of 6 servers.Therefore anyon knows how to configure that.Anticipating a helpful information.

Thanking you all
Manish
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-07-2007, 02:28 AM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Rep Power: 0
tom is an unknown quantity at this point
Default

Welcome to nixCraft forum!

Most people use Linux virtual server (LVS) which is a highly scalable and highly available server built on a cluster of real servers, with the load balancer running on the Linux. Visit The Linux Virtual Server Project - Linux Server Cluster for Load Balancing site for more information. Can you tells us a bit about your application? Do you want failover or load balancing or combination of both? Do you want SSL support? Do you use centralized SAN storage? What about MySQL/Oracle? Do your need solution for that too...

So many factors more you tell us the right information you will get...
Reply With Quote
  #3 (permalink)  
Old 06-07-2007, 05:09 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Centos & Freebsd
Posts: 15
Rep Power: 0
manish_2479 is on a distinguished road
Send a message via AIM to manish_2479 Send a message via MSN to manish_2479 Send a message via Yahoo to manish_2479
Default apache load balancing and failover

Hi Tom

Well I wana use MYSQL 5 and 6 both and will act as master and slave , php4 and php5 on same server and also need both the failover and loadbalancing too . And I also wana use SSL .for MYsql I am gone a setup on centos and for apache and php on freebsd-6.2.. Well I need solution if you can help me out.

Thanking you
Reply With Quote
  #4 (permalink)  
Old 06-07-2007, 06:58 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 967
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

manish,

LVS can do that, all these servers located in local data center or remote data center?


For MySQL use official mysql load balancing server as follows

Mysql cluster
master <==> slave

If master goes down slave will take place, official cluster will do sync between two server. Minimum 3 servers required for mysql clustering. Please read following tutorials. Go with 5.1 as it is stable and working well:
Official mysql clustering information => MySQL AB :: MySQL Cluster
A good tutorial => How To Set Up A Load-Balanced MySQL Cluster | HowtoForge - Linux Howtos and Tutorials
Apache load balacing tutorial How To Set Up A Loadbalanced High-Availability Apache Cluster | HowtoForge - Linux Howtos and Tutorials

Following diagram will clear your idea:
Code:
    Internet 
          |
          |
Linux LVS Loadbalacer 2 servers
        |                     |
        |                     |
      /  \                   /  \
Mysql cluster                Apache  
2 server                     2-3 servers
You need to install MySQL cluster management server on one of the LVS load balancer. To sync web server server you can use rsync or use DRDB. Third possibility is use centralized SAN to push data to all server.

Hope this helps! If you have other problem just hit reply button
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #5 (permalink)  
Old 06-08-2007, 02:13 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Centos & Freebsd
Posts: 15
Rep Power: 0
manish_2479 is on a distinguished road
Send a message via AIM to manish_2479 Send a message via MSN to manish_2479 Send a message via Yahoo to manish_2479
Default

Hi
Thanks a lot.Well but how will be the httpd.conf file configuration. Is that the same configuration on all server or something different. And yea I also wan't to use both PHP4 for certain application and PHP5 for certain application so how to make it to run both version of PHP with all of this apache server. And also wana know is that apache 2.2 is stable.

Thanking you
Manish
Reply With Quote
  #6 (permalink)  
Old 06-08-2007, 12:03 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 578
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

httpd.conf and other config file should be the same for all servers. You must use same docroot such as /var/www. You must sync /var/www across all the boxes. You can run php4/php5, perl, python etc. Apache 2.2 is stable no problem.

I recommend trying tests in a dummy environment and later move to production.

Good luck
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #7 (permalink)  
Old 06-08-2007, 08:01 PM
Junior Member
User
 
Join Date: Jun 2007
My distro: Centos & Freebsd
Posts: 15
Rep Power: 0
manish_2479 is on a distinguished road
Send a message via AIM to manish_2479 Send a message via MSN to manish_2479 Send a message via Yahoo to manish_2479
Default

I wan't to trun both php4 and php5 on all servers cause some application needs php4 and some application needs php5. Well and what about thae Ethernet address configuration cause if I define IP's in httpd.conf file then what about the ethernet address config we can't set all server's ethernet with the same IP's so how to deal with that.
Reply With Quote
  #8 (permalink)  
Old 06-12-2007, 04:45 PM
raj raj is offline
Contributors
User
 
Join Date: Jun 2005
Location: Hyderabad
Posts: 148
Rep Power: 4
raj is on a distinguished road
Default

Apache node 1 - IP address: 192.168.0.101 and document root: /var/www
Apache node 2 - IP address: 192.168.0.102 and document root: /var/www
Load Balancer node 1: IP address: 192.168.0.103
Load Balancer node 2: IP address: 192.168.0.104
Virtual IP Address: 192.168.0.105

You need to assign 192.168.0.105 in httpd.conf Load balacner will take care of ip assign and other stuff. See image attached

Take printout of all docs located at LVS Documentation so that you can understand everything
Attached Images
File Type: jpg ultramonkey.jpg (31.0 KB, 16 views)
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Apache Load blance vimalgoel Web servers 3 07-23-2007 04:51 PM
Howto Load Balancing Mysql and a web server zafar466 Databases servers 1 03-27-2007 10:04 AM
linux clustering newbie_guy Linux software 2 02-15-2007 08:13 AM
Load balancing pooling print jobs using CUPS print queues raj Getting started tutorials 0 01-16-2007 09:08 PM
Load Balancing. asim.mcp Linux software 1 10-17-2006 05:49 AM


All times are GMT +5.5. The time now is 06:04 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36