Web, Email And MySQL Database Cluster (Mirror) On Debian 6

Discussion in 'HOWTO-Related Questions' started by mccyberix, May 11, 2012.

  1. mccyberix

    mccyberix Member

    hi folks,

    I build up a Web, Email And MySQL Database Cluster (Mirror) On Debian 6 according to the tutorial from Falko, I have 2 load balancers and 2 nodes, I'm balancing http and smtp with HAproxy, everything seems to be ok just some little things dont work as I expect... I have no previous experience with clusters so I'm not shure if the issues are normal or not, so please could somebody help me understand this.

    1. when I try to access ispconfig3 over the virtual IP it fails but when I use one of the nodes IP's it will work.

    2. when I try to access webmail (squirrelmail) over the virtual IP it works fine but when I try it like this: http://www.somedomain.tld/squirrelmail (www.somedomain.tld points to the virtual IP)
    I will get the login screen but my username & password will not be accepted, this issue is a little bit anoying.

    3. when I try to receive & send mail over the virtual IP it fails but when I use one of the nodes IP's it works fine, transports to the virtual IP work also well.

    thanks in advance!
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Something seems to be wrong with your virtual IP. Please check with
    Code:
    ifconfig 
    on the active node that the virtual IP is listed.
     
  3. mccyberix

    mccyberix Member

    thanks for reply falko,
    you mean on the active loadbalancer I guess, because the nodes behind doesnt have virtual IP's, as far as I have understood the behavior of HAProxy is that it will route the requests hitting the virtual IP to one of the backend nodes where both nodes are always active but maybe I'm wrong...
    ok, when I do a 'ifconfig' I do not see the virtual IP on both loadbalancers but when I do 'ip addr sh eth0' I will see it

    ifconfig output:
    ip addr sh eth0 output on the active LB, my virtual IP is '192.168.1.100'

    when I bring down the active load balancer the virtual IP wil be passed to the second one as it should.

    I've made some testing and come to that point that squirrelmail is not able to authenticate logins when reached over the virtual IP, when I connect directly to one of the backends IP's there is no problem to log in. This is the only thing what I realy have to change since I dont realy need to connect to ISPConfig via my virtual IP.

    thanks in advance!
     
  4. mccyberix

    mccyberix Member

    i have just noticed when I'm trying to login via the virtual IP I get the squirrelmail message "you must be logged in to access this page", when I refresh this page squirrelmail shows me the list of my emails but when I try to open one I'm logged out, so I think my sessions are not handled correctly...
    here is my HAProxy config, maybe I've configured somthing wrong:
     
  5. mccyberix

    mccyberix Member

    [SOLVED] Web, Email And MySQL Database Cluster (Mirror) On Debian 6

    after some testings I was able to find the solution, it was the HAProxy, I have changed "cookie JSESSIONID prefix" to "cookie JSESSIONID insert nocache" in the "/etc/haproxy/haproxy.cfg" to be able to login to my webmail (sqirrelmail/roundcube).

    here is a documentation snippet explaining the behaivior of that particular option:

     

Share This Page