Sticky session in mod_cluster 1.3.0 + jboss 6.3.3

1k views Asked by At

I have a setup with 1 mod_cluster (1.3.0) and 2 JBoss (6.3.3). I am trying to use stickysession but I cannot see the cookie in the response and the requests are being served by different nodes.

Using default mod_cluster config (with my IP)

<IfModule manager_module>
  Listen 156.24.221.149:6666
  ManagerBalancerName mycluster
  <VirtualHost 156.24.221.149:6666>
    <Location />
     Require ip 156.24
    </Location>

    KeepAliveTimeout 300
    MaxKeepAliveRequests 0
    #ServerAdvertise on http://@IP@:6666
    AdvertiseFrequency 5
    #AdvertiseSecurityKey secret
    #AdvertiseGroup @ADVIP@:23364
    EnableMCPMReceive

  </VirtualHost>

  <Location /mod_cluster_manager>
     SetHandler mod_cluster-manager
     Require ip 156.24
  </Location>


</IfModule>

I tried using ProxyPass as well but according to this response (Sticky session not working with multiple apache vhosts and multiple JBoss 7.2 server-groups) it is now redundant and sticky should be default behaviour.

Edit #2: no longer using this virtual host definition ServerName dar.com

#  ProxyPass / balancer://mycluster stickysession=JSESSIONID
#  ProxyPassReverse / balancer://mycluster
#  ProxyPreserveHost On

  ErrorLog "logs/vhost1_error.log"
  CustomLog "logs/vhost1_access.log" common
</VirtualHost>

Did not change JBoss config, just running standalone-ha.xml

Any advice on how to solve/debug this issue?

Thanks.

Edit: added mod_cluster snapshot. For the record, I had to take the mod_cluster config in the httpd.conf file outside the virtual host definiton (otherwise I could not access the resource). mod_cluster config

1

There are 1 answers

5
Thiago Chagas - Batata On

I've made this works with another scenario (wildfly10 in domain mode), however it will be the same configuration.

Ref: Modcluster 1.3.0 with Wildfly 10.1.0

Use this:

<VirtualHost *:80>
  ServerName dar.com

  ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
  ProxyPassReverse / balancer://mycluster
  ProxyPreserveHost On

  ErrorLog "logs/vhost1_error.log"
  CustomLog "logs/vhost1_access.log" common
</VirtualHost>

And then, when you access the 'dar.com' on your browser, the session will be "sticked".