Results 1 to 5 of 5
  1. #1

    Two Node clustering !!

    Hello,

    We want to setup HA cluster of two nodes (centos 6.5) for our site.As we're running out of resources so we don't want to buy another server for loadbalancing (haproxy installed into it). Currently i am trying to install both haproxy and apache webserver on the same nodes to perform them as webservers as well as fail-over, so if one goes down other will be backup. So, the current setup is as follows :

    Node-1(192.168.1.70) = haproxy + apache(listening on 80 port) + keepalived on VIP(192.168.1.220)

    Node-2(192.168.1.80) = haproxy + apache(listening on 80 port) + keepalived on VIP(192.168.1.220)

    Haproxy is listening on VIP for both nodes.
    Apache webservers are listening on their node ips i.e Node-1: 192.168.1.70:80 Node-2:192.168.1.82.

    The issue i am having is whenever i browse the VIP(192.168.1.220) on browser, it shows the error "Currently no server is there to handle the request".

    Following is the haproxy.cfg config on node-1 and node-2 :

    global
    log 127.0.0.1 local0
    log 127.0.0.1 local1 notice
    #log loghost local0 info
    maxconn 4096
    #debug
    #quiet
    user haproxy
    group haproxy

    defaults
    log global
    mode http
    option httplog
    option dontlognull
    retries 3
    option redispatch
    maxconn 2000
    contimeout 5000
    clitimeout 50000
    srvtimeout 50000



    listen webfarm 192.168.1.220:80
    mode http
    balance source
    cookie JSESSIONID prefix
    #option httpchk HEAD /check.txt HTTP/1.0
    option httpchk HEAD / HTTP/1.0
    option httpclose
    option forwardfor
    server web1 192.168.1.70:80 cookie A check
    server web2 192.168.1.80:80 cookie b check

    Could you please guide me if the cluster architecture is fine ?

    Regards.
    Shahzaib

  2. #2
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    I assume you're trying this setup:

    http://gcharriere.com/blog/?p=339

    There's a lot of additional setup on the keepalived and ipfilters part that I don't know if you've done. Give it a shot to see if that clears it.

  3. #3
    Thanks for reply, haven't check this out yet. But the thing i want to be clear about is, does haproxy has issue when listening on the same port (80) as the apache is also on same server listening on 80 port ?

  4. #4
    Join Date
    Jul 2009
    Location
    UK
    Posts
    1,308
    Quote Originally Posted by shahzaibcb View Post
    Thanks for reply, haven't check this out yet. But the thing i want to be clear about is, does haproxy has issue when listening on the same port (80) as the apache is also on same server listening on 80 port ?
    HA proxy runs on a different IP than the Httpd process though?

    Ie: HA is on 220 rather than .70 and .80..

    As long as HA proxy listens on port 80 on 220 and apache listens on port 80 on .70 and .80. Its should be ok.

    You would have issues if HA proxy AND apache both listened on port 80 on the same IP address,

    a "netstat -tunap | grep 80" would probably show you what is on port 80 and on what IP
    Live Chat Support Software for your Business website - IMsupporting.com

  5. #5
    Thanks for clearing up my confusion guyz . I don't know what was wrong before as the same architecture is working fine now. :-|

    The ip(192.168.1.220) is not actually the ip of any eth0 but the VIP of keepalived to check the health of haproxy on both server.

    Apache + haproxy on both server is working fine now. If i stop one webserver the request route to other server(Nice). Next step is to install mysql on same both nodes and make them Master-Master cluster via haproxy.

    Any suggestion before proceeding?

Similar Threads

  1. Convert Old hypervm node into solusvm slave node - possible?
    By Siterack_net in forum Hosting Software and Control Panels
    Replies: 5
    Last Post: 10-10-2011, 05:14 AM
  2. Replies: 0
    Last Post: 03-08-2011, 01:16 PM
  3. Replies: 0
    Last Post: 10-22-2010, 08:28 AM
  4. Replies: 0
    Last Post: 06-23-2010, 04:05 AM
  5. Clustering
    By intigret in forum Web Hosting
    Replies: 44
    Last Post: 12-14-2002, 07:13 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •