0 Replies Latest reply on Feb 18, 2011 2:40 AM by Willem Noorduin

    jboss clustering and mod_proxy_balancer

    Willem Noorduin Newbie

      We are setting up a jboss-as 5.1+ cluster with two different JBoss-AS servers (jboss1 and jboss2) and setting up such that we can reach
      the application via a URL which is served in an Apache Webserver. Using mod_cluster, this runs smoothly. Because I am not really sure if
      I can persuade our production organization to go aboard with mod_cluster just yet, so I try to setup the next worst thing, a proxy_ajp setup.
      Here I define the following for my cluster:

      <Proxy balancer://testcluster/>
              BalancerMember ajp://jboss1:8009/application/ keepalive=On status=-H
              BalancerMember ajp://jboss2:8009/application/ keepalive=On status=-H


      and the following for the Virtual host:


      <VirtualHost *:80>
          ServerAdmin tweedledeel@tweedledum.com

          DocumentRoot /apps/data/www.application.nl/data
          ServerName www.application.nl

          ErrorLog logs/test-error_log
          CustomLog logs/test-access_log combined
          LogLevel debug

          ProxyPass /application balancer://testcluster/ stickysession=JSESSIONID|jsessionid

          <Location /balancer-manager>
              SetHandler balancer-manager


      and I deploy application.war to the two jboss-as servers jboss1 and jboss2 all goes well, and I can reach the application (which is a version of clustejsp by the way, consisting of HaJsp.jsp (the entry page) and ClearSession.jsp, which you can reach via a button on HaJsp.jsp) via the link:




      When I hit the ClearSession.jsp button, I get a 404 Not Found error. Upon inspection of the address bar in the brwoser, I see:




      Which is of course not there (http://www.application.nl/application/ClearSession.jsp is existing though). Strange thing is, that when I do the same
      thing with:




      [Notice the trailing /]. the application works fine.



      Is it possible via an extra command or something else in the cluster configuration or in the Proxy statement to get this working (most reallife users can't deal with the extra /) ?

      I'd rather not rooting for mod_rewrite here now, but if someone has a working example, it would be welcomed also (I have tried several things, like:


          # Adding a trailing / if it is not there

          RewriteCond %{REQUEST_FILENAME} !-f

          RewriteCond %{REQUEST_URI} !\..+$

          RewriteCond %{REQUEST_URI} !/$

          RewriteRule (.*) http://poc.brpp.nl.post.tnt/$1/ [R=301,L]

          # End Adding a trailing / if it is not there


      but am always ending up with extra /'shes in the addressbar (something a reallife user is going to make a fuss about).


      My guess is that my Poxy statements are creating a cluster allright, but don't isolate an application totally (while doing things with the application inside the war, break out easily out of the context of the application.


      mod_cluster does an excellent job in application isolation, and in mod_jk you can just punch in the right JkMount command.