Set Up A Loadbalanced High-Availability Apache Cluster

Discussion in 'HOWTO-Related Questions' started by gg234, Apr 27, 2006.

  1. gg234

    gg234 New Member

    Hi,

    This is nice walk through and i have one question about this in this example you have menctioned only two nodes with static ipaddress

    Apache node 1: webserver1.example.com (webserver1) - IP address: 192.168.0.101; Apache document root: /var/www
    Apache node 2: webserver2.example.com (webserver2) - IP address: 192.168.0.102; Apache document root: /var/www

    My question is if i am hosting webserver with static and virtual ipaddress how does loadbalace will work with the virtual ipaddresses.Ultramonkey is having some problems with the virtual ipaddresses and hosting websites on that .Whenever any user send a incoming request it goes through virtual ip and it should reach the website hosting on virtual ipaddress.How we will go about this?

    Thanks
     
  2. falko

    falko Super Moderator Howtoforge Staff

    I don't know if this setup works if you have multiple web sites on your web server. Normally a web server cluster is something for a high-traffic web site (i.e., you host just one big web site on the cluster nodes).
     
  3. calande

    calande New Member

    As a side note, I'm looking for a web hosting supplier that offers PostgreSQL clustering (read/write) with unlimited scaling. Do you know any?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Unfortunately, I don't know of such a hosting company... :(
     
  5. calande

    calande New Member

    Argh... And I thought PostgreSQL would scale better than MySQL...
     
  6. calande

    calande New Member

    A quick head up here :)
    Could you recommend good MySQL cluster hosting companies with unlimited scaling?
     
  7. falko

    falko Super Moderator Howtoforge Staff

    Same answer as before... :(
    If you need a MySQL cluster, you should think about renting some dedicated servers.
     
  8. calande

    calande New Member

    I already rent 2 dedicated servers but my supplier doesn't know how to set up a cluster environment, only load balancing with an F5 BigIP...
     
  9. falko

    falko Super Moderator Howtoforge Staff

    You can have a look at the clustering howtos here on HowtoForge, but I guess you'll need more than two servers (or you set up virtual machines on your hardware with Xen or OpenVZ (we also have tutorials for this :) )).
     
  10. calande

    calande New Member

    Thank you Falko. Most probably your cluster tutorial is very well written ;)
    Problem is that I'm not a technical person at all :(
    I need a company to set it up and manage it for me...:rolleyes:
     
  11. calande

    calande New Member

    If you had to choose between MySQL 5 and PostgreSQL 8 for a large application such as digg.com or slashdot.org that grows fast and needs several servers to offer a responsive service, what would you choose? I think a MySQL cluster cuts it, right? I haven't been able to find a good PostgreSQL cluster solution out there... Seems like there are more DBAs who are good at MySQL clustering too...

    What do you think?
     
  12. falko

    falko Super Moderator Howtoforge Staff

    I don't have much experience with PostgreSQL, so I'd vote for MySQL. And with the new MySQL 5.1, you can create clusters that don't need to run in RAM anymore (as was the case with previous versions). :)
     
  13. golemlsit

    golemlsit New Member

    Failover with persistent connections

    Hello and thanks for the tutorial...
    I'm trying to set it up on centos servers,
    the problem I have is I'd like to use the
    persistent=3600
    option in ldirectord.cf because I need session affinity.
    The problem is , when I turn off an apache ( service httpd stop )
    ldirector keeps the users which have been sent on that real server
    on that connections and they get a 'server unreachable'.
    Using ipvsadm I still see their connections as InActConn, even if the weight is
    now set to 0.
    Is there a way to clear the connection table when a real server goes down?

    Another thing I noticed is that you list ips for the webservers (192.168.0.101, 192.168.0.102) but never tell to configure an interface (es eth0:0) for them.
    If I understood correctly the only ip which is brought up and down by the system is the VIP (192.168.0.105), all the others must already be up on the 2 nodes, right?

    Thanks a lot
    G.
     
  14. golemlsit

    golemlsit New Member

  15. noahlau

    noahlau New Member

    hello all,

    is it possible to use same machine ( load balancer ) to load balance both httpd and mysql ?

    many thanks!
     
  16. falko

    falko Super Moderator Howtoforge Staff

    I haven't tried, but I don't see why it shouldn't work. :)
     
  17. markg85

    markg85 New Member

    Hi all,

    First of all.. thanx falko for the grwad howto :)

    i`ve followed every step on the howto and the loadbalancing itself seems to work oke now. i just can`t get the apache servers to work because of this:

    "vi /etc/network/interfaces"
    Code:
    auto lo:0
    iface lo:0 inet static
      address 192.168.0.105
      netmask 255.255.255.255
      pre-up sysctl -p > /dev/null
    
    the file where i need to place it in doesn`t exist... nor does the directory /etc/network/...

    i did yound out that you would probably have to use : /etc/sysconfig/network-scripts/ifcfg-lo:0 to do these changes but than again i can`t get it working..

    I`m running Fedora core 6 (4 times in vmware) all the loadbalancing tests that you describe in your howto are positive for me.. that network part is the last part that i need to get working... if i enter the ip`s of the webservers i`m just getting the defualt apache page (which is good) and not with 192.168.0.105.. though i can ping that ip.. but that`s probably because of the loadservers..

    Any help would be gread.
    Thanx alot anyways.
     
  18. markg85

    markg85 New Member

    hmm.. i`ve just tested alot and first i had "could not connect" and after ALOT of testing i finally have another error :p now it`s : "connection timed out"

    so it might not be that network problem i thought about earlyer.
    help please.. and i`m still not getting ifcfg-lo:0 to work... as soon as i enable it i get unable to connect and i can`t even ping the server anymore (not the virtual ip but the server with the actual ip)
     
  19. falko

    falko Super Moderator Howtoforge Staff

    I'm not sure how this pre-up stuff can be done on Fedora...
    What's the output of
    Code:
    ls -la /etc/sysconfig/network-scripts
    ?
     
  20. omen

    omen New Member

    Hi Falko,

    I'm running a multiple website but I'm willing to try .. just 1 question, how do I point the domain name? only to 1 ip or to both load balancer?
     

Share This Page