1

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

mkcons
  • 155
  • 1
  • 8
  • I'd refer to this [Sticky sessions are not maintained in mod cluster load balancer for jboss eap 7](https://serverfault.com/questions/847124/sticky-sessions-are-not-maintained-in-mod-cluster-load-balancer-for-jboss-eap-7) as it provides some troubleshooting techniques. If you dont find the JBoss Dev forum link there [it's](https://developer.jboss.org/thread/274821) - after going through the ServerFault Q&A - go to the Jboss forum and review everything as the person that helped out explained what was wrong with the configuration. If you get it working, Add an answer to your own question. – JGlass Feb 07 '18 at 13:36
  • And accept the answer ;-) for other people. – JGlass Feb 07 '18 at 13:37
  • Thanks, haven't figured it out yet. I checked https://stackoverflow.com/questions/38299026/jboss-eap6-4-and-mod-cluster?rq=1 as well but so far nothing. – mkcons Feb 08 '18 at 08:15
  • And you went through the [JBoss Forum Post](https://developer.jboss.org/thread/274821) and it didnt help? – JGlass Feb 08 '18 at 13:42
  • Yeah, my take from that post was to run JBoss defining the instance id property, but it did not change anything. I'm going to reset things and start with new VMs. – mkcons Feb 09 '18 at 14:29
  • Could you post a photo from your mod_cluster_manager ? – Thiago Chagas - Batata Feb 09 '18 at 14:49
  • Sure. You'll notice that I'm accessing the web server by IP, I removed the virtual host definition on port 80. – mkcons Feb 09 '18 at 16:38

1 Answers1

0

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".

  • When you are accessing the application by the browser, what is the JSESSION_ID that appears in the requests? – Thiago Chagas - Batata Feb 09 '18 at 14:48
  • I'm using CURL, I tried doing : [root@rhel-1 httpd]# curl -X POST dar.com:8080/orch/api/****/** -v * About to connect() to dar.com port 8080 (#0) * Trying 156.24.221.149... * Connected to dar.com (156.24.221.149) port 8080 (#0) > POST /orch/api/****/** HTTP/1.1 > User-Agent: curl/7.29.0 > Host: dar.com:8080 > Accept: */* > < HTTP/1.1 200 OK < Date: Fri, 09 Feb 2018 16:19:06 GMT < Content-Type: application/json < Transfer-Encoding: chunked < * Connection #0 to host dar.com left intact {"box":"site2-core1"} – mkcons Feb 09 '18 at 16:19
  • the box attribute changes almost every time, that's how I see where it executes. – mkcons Feb 09 '18 at 16:23
  • I know that you've already said that saw in another question, however have you tried to rename both the nodes to a simpler name(without '-' or uppercase) like 'node1' and 'node2'? – Thiago Chagas - Batata Feb 09 '18 at 18:17
  • I would suggest you to see your apache's error.log on service start and what is going on Jboss 6 server's log. The problem is that apache and jboss are not talking correctly, so jboss doesn't know the difference between node1 e node2. – Thiago Chagas - Batata Feb 14 '18 at 11:32