-
1. Re: mod_cluster and ProxyPass directives
jfclere Nov 25, 2011 6:17 AM (in response to syncmaster2009)"load=-1"
There should be a problem between httpd and TC7, check the error_log use debug and retry.
-
2. Re: mod_cluster and ProxyPass directives
syncmaster2009 Nov 25, 2011 9:40 AM (in response to jfclere)I have no errors worthy of detail except that all workers in error state (just one for tc7) and load=-1
-
3. Re: mod_cluster and ProxyPass directives
syncmaster2009 Nov 25, 2011 4:21 PM (in response to syncmaster2009)Ok, for 3), problem solved. The Tomcat AJP port was coliding with one of the Jboss instances (ports-default).
So it's working.
For 1) or 2) is there a solution if I don't want to use an application server and join it to the mod_cluster?
-
4. Re: mod_cluster and ProxyPass directives
jfclere Nov 28, 2011 4:19 AM (in response to syncmaster2009)Try to remove the ProxyPass directive and rely on mod_cluster only.
-
5. Re: mod_cluster and ProxyPass directives
syncmaster2009 Nov 28, 2011 6:44 AM (in response to jfclere)That solution only is possible if the other servers are Jboss/Tomcat family... I I have another Apache or Websphere or Weblogic, I can't do that...
-
6. Re: mod_cluster and ProxyPass directives
syncmaster2009 Nov 28, 2011 11:07 AM (in response to syncmaster2009)Regarding solution 3), letting mod_cluster do all the work, in my mix of Jboss server 5.1 and Tomcat 7, sometimes request get mangled and go to the wrong server wich results in Page not founds...
So it's also not a solution... :-(
-
7. Re: mod_cluster and ProxyPass directives
jfclere Nov 29, 2011 2:33 AM (in response to syncmaster2009)A mix of AS5.1 and TC7 should work if not that is a configuration error, webapp timeout or bug in mod_cluster.
-
8. Re: mod_cluster and ProxyPass directives
syncmaster2009 Nov 29, 2011 5:22 AM (in response to jfclere)The strange thing is that I've done all my tests on Linux OS (I'm a Linux user...) and everything worked fine, but on the customer that is using W2008 R2 64bit it has the above described behavior... Strange..
I'm going to look at it more time...
-
9. Re: mod_cluster and ProxyPass directives
syncmaster2009 Dec 4, 2011 11:31 AM (in response to jfclere)Not sure, but it might be a bug...
Let's see:
I have two Jboss servers J1 and J2, and one Tomcat Server T7.
On J1 and J2 I have application A1 that at first access it generates a JSESSIONID cookie.
On T7 I have application B1 that also generates a cookie, and application B2 that is plain HTML pages, and so no cookies.
Acessing to the URL of application A1, it seems that it always go to the JBoss servers, and after the cookie is set the session gets sticky and so no problems.
If acessing URL of application B1, while it hits Jboss servers, it gives page not found, and refreshing moves the server that is being hit, but if it hits Tomcat, the cookie is set and after that it sticks to the T7 server, so no issues.
Now for the application B2, because it never sets a cookie it works ok, and the it fails, works ok and it fails, and this happens because mod_cluster is choosing Jboss or TC7, the Jboss and the TC7, and so on...
It seems that the logic for selecting the server is failing to select the correct destination server based on the URL...
Now, I can only see this behaviour on Windows server platform (huggg....) and not on my Linux test machines.... Strange.
I can add a log, if necessary.
-
10. Re: mod_cluster and ProxyPass directives
erhard Feb 11, 2012 2:07 PM (in response to syncmaster2009)I would like to use a setup like this in order to use mod_cluster in a general-puropse Apache-server:
{code}
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule manager_module modules/mod_manager.so
ProxyPass /togoogle http://www.google.com
ProxyPassReverse /togoogle http://www.google.com
ProxyPass /bla balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse /bla balancer://mycluster
CreateBalancers 1
<IfModule manager_module>
Listen 192.168.40.129:6666
ManagerBalancerName mycluster
<VirtualHost 192.168.40.129:6666>
ServerName devjava
LogLevel debug
<Location />
Order deny,allow
Deny from all
Allow from 192.168
</Location>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from all
</Location>
</VirtualHost>
</IfModule>
{code}
When I now get http://localhost/togoogle, mod_cluster rewrites the url to balancer://mycluster/togoogle and finally calls my JBoss: http://192.168.123.231:8080/togoogle. mod_cluster seems to highjack the whole Apache(?)
When I do a similar setup with mod_proxy_balancer:
{code}
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
ProxyPass /togoogle http://www.google.com
ProxyPassReverse /togoogle http://www.google.com
ProxyPass /jboss balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse /jboss balancer://mycluster
<Proxy balancer://mycluster>
BalancerMember http://192.168.40.129:8080
</Proxy>
{code}
I get Google with http://localhost/togoogle and my JBoss with http://localhost/jboss as expected. I think it would be great if this would work also with mod_cluster.
Apearently the translation in the ProxyPath directive between the fake name (/togoogle) and real name (http://www.google.com) is not done with mod_cluster. With mod_proxy_balancer this is done in mod_proxy.c: proxy_trans():
{code}
ap_hook_translate_name(proxy_trans, aszSucc, NULL, APR_HOOK_FIRST);
...
static int proxy_trans(request_rec *r)
...
len = alias_match(r->uri, fake);
if (len != 0) {
...
found = apr_pstrcat(r->pool, "proxy:", real,
use_uri + len, NULL);
}
...
{code}
With mod_cluster the hook ap_hook_translate_name() seems to be overwritten by mod_proxy_cluster.c:proxy_cluster_trans()
{code}
ap_hook_translate_name(proxy_cluster_trans, aszPre, aszSucc, APR_HOOK_FIRST);
{code}
which doesn't do the translation between fake and real name.
So is there a fundamental problem in supporting the ProxyPass like mod_proxy_balancer does, is it planned to be implemented or is there just another way to configure it?
-
11. Re: mod_cluster and ProxyPass directives
jfclere Feb 13, 2012 4:33 AM (in response to erhard)You have excluded ROOT from the context in the jboss configuration?
-
12. Re: mod_cluster and ProxyPass directives
erhard Feb 13, 2012 4:43 AM (in response to jfclere)I'm not sure that I understand you correctly. I didn't exclude anything on purpose. JBoss is pretty much configured as default. The ROOT-Application is accessible on http://192.168.123.231:8080/ and mod_cluster is configured as shown above (without ProxyMatch !... or similar).
-
13. Re: mod_cluster and ProxyPass directives
jfclere Feb 13, 2012 5:39 AM (in response to erhard)http://docs.jboss.org/mod_cluster/1.2.0/html/java.properties.html
If you haven't excluded ROOT than everything will go to jboss and the logic of Proxypass/
ProxyPassReverse are skipped.
-
14. Re: mod_cluster and ProxyPass directives
erhard Feb 13, 2012 7:20 AM (in response to jfclere)Ok, I think I understand what you mean now, but in this case I kept the defaults and ROOT is in the excluded-contexts by default. My mod_cluster config in JBoss is:
{code}
[standalone@192.168.123.231:9999 /] ls subsystem=modcluster/mod-cluster-config=configuration
ssl advertise=true
advertise-socket=modcluster auto-enable-contexts=true
balancer=mycluster excluded-contexts=ROOT,admin-console,invoker,jbossws,jmx-console,juddi,web-console
flush-packets=false flush-wait=-1
max-attemps=1 node-timeout=-1
ping=10 proxy-list=/
socket-timeout=20 sticky-session=1
sticky-session-force=false sticky-session-remove=false
stop-context-timeout=10 ttl=60
{code}
I use the standalone-config.
Aside from this I don't understand why excluding ROOT (/) from the target (jboss) should make a difference on the source context (apache). In my opinion it would be a useful configuration to write:
ProxyPass /jboss balancer://mycluster
and send everything that starts with /jboss to the cluster. However, this is not my concern right now.