Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th May 2012, 12:42
mccyberix mccyberix is offline
Member
 
Join Date: Aug 2006
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Web, Email And MySQL Database Cluster (Mirror) On Debian 6

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!
Reply With Quote
Sponsored Links
  #2  
Old 12th May 2012, 11:16
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Something seems to be wrong with your virtual IP. Please check with
Code:
ifconfig
on the active node that the virtual IP is listed.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 14th May 2012, 10:42
mccyberix mccyberix is offline
Member
 
Join Date: Aug 2006
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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:
Quote:
Load balancer A

eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: xxxx::xxx:xxxx:xxx:xxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2077714 errors:0 dropped:0 overruns:0 frame:0
TX packets:2616483 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:213504803 (203.6 MiB) TX bytes:179658037 (171.3 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6440 errors:0 dropped:0 overruns:0 frame:0
TX packets:6440 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:685982 (669.9 KiB) TX bytes:685982 (669.9 KiB)

Load balancer B

eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.1.106 Bcast:192x168x1.255 Mask:255.255.255.0
inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2332208 errors:0 dropped:0 overruns:0 frame:0
TX packets:2327326 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240938546 (229.7 MiB) TX bytes:164913693 (157.2 MiB)
Interrupt:18 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5636 errors:0 dropped:0 overruns:0 frame:0
TX packets:5636 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:506376 (494.5 KiB) TX bytes:506376 (494.5 KiB)
ip addr sh eth0 output on the active LB, my virtual IP is '192.168.1.100'

Quote:
active load balancer

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 192.168.1.101/24 brd 192.168.1.255 scope global eth0
inet 192.168.1.100/24 scope global eth0
inet6 xxxx::xxx:xxxx:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever
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!
Reply With Quote
  #4  
Old 14th May 2012, 12:38
mccyberix mccyberix is offline
Member
 
Join Date: Aug 2006
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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:
Quote:
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.100:80
mode http
option httplog
stats enable
stats auth userass
balance roundrobin
cookie JSESSIONID prefix
option httpclose
option forwardfor
option httpchk HEAD /check.txt HTTP/1.0
server webA 192.168.1.105:80 cookie A check
server webB 192.168.1.106:80 cookie B check

listen smtp 192.168.1.100:25
mode tcp
option tcplog
balance roundrobin

server smtpA 192.168.1.105:25 weight 1 maxconn 500 check
server smtpB 192.168.1.106:25 weight 1 maxconn 500 check
Reply With Quote
  #5  
Old 16th May 2012, 11:29
mccyberix mccyberix is offline
Member
 
Join Date: Aug 2006
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default [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:

Quote:
insert This keyword indicates that the persistence cookie will have to
be inserted by haproxy in server responses if the client did not

already have a cookie that would have permitted it to access this
server. When used without the "preserve" option, if the server
emits a cookie with the same name, it will be remove before
processing. For this reason, this mode can be used to upgrade
existing configurations running in the "rewrite" mode. The cookie
will only be a session cookie and will not be stored on the
client's disk. By default, unless the "indirect" option is added,
the server will see the cookies emitted by the client. Due to
caching effects, it is generally wise to add the "nocache" or
"postonly" keywords (see below). The "insert" keyword is not
compatible with "rewrite" and "prefix".

prefix This keyword indicates that instead of relying on a dedicated
cookie for the persistence, an existing one will be completed.
This may be needed in some specific environments where the client
does not support more than one single cookie and the application
already needs it. In this case, whenever the server sets a cookie
named <name>, it will be prefixed with the server's identifier
and a delimiter. The prefix will be removed from all client
requests so that the server still finds the cookie it emitted.
Since all requests and responses are subject to being modified,
this mode requires the HTTP close mode. The "prefix" keyword is
not compatible with "rewrite" and "insert".
Reply With Quote
Reply

Bookmarks

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing A Web, Email & MySQL Database Cluster On Debian 6.0 With ISPConfig 3 - Hig dghvoip HOWTO-Related Questions 0 28th April 2012 06:22
Web, Email & MySQL Database Cluster xzibiz Installation/Configuration 3 2nd April 2012 08:54
MySQL Replication on Web, Email And MySQL Database Cluster matiasCU Installation/Configuration 0 24th October 2011 09:21
Multiserver Setup With Dedicated Web, Email, DNS And MySQL Database Servers On Debian johjoh2k HOWTO-Related Questions 7 11th February 2011 14:26
Multiserver Setup With Dedicated Web, Email, DNS And MySQL Database Servers On Debian jmh_fl HOWTO-Related Questions 3 25th September 2010 14:48


All times are GMT +2. The time now is 18:56.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.