Search code examples
apachehttpd.confmod-jkjboss-eap-6

Apache httpd configuration with clustered jboss eap 6.4 standalone environemnt


I am using JBoss EAP 6.4.0

I am using 2 instances of jboss standalone server in same machine and forming a cluster. When i login into them, it works fine.

Now, I am trying to use mod_jk to load balance so that I need not use port to access the application. Login page comes up. After giving credentials, it tries to login and then automatically logs out.

My workers.properties file:

# Define list of workers that will be used
# for mapping requests
# The configuration directives are valid
# for the mod_jk version 1.2.18 and later
#
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=localhost
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.prepost_timeout=10000 #Not required if using ping_mode=A
worker.node1.connect_timeout=10000 #Not required if using ping_mode=A
worker.node1.ping_mode=A #As of mod_jk 1.2.27

# Define Node2
worker.node2.port=8109
worker.node2.host=localhost
worker.node2.type=ajp13
worker.node2.lbfactor=1
worker.node2.prepost_timeout=10000 #Not required if using ping_mode=A
worker.node2.connect_timeout=10000 #Not required if using ping_mode=A
worker.node2.ping_mode=A #As of mod_jk 1.2.27


# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=TRUE

# Status worker for managing load balancer
worker.status.type=status

This was working fine in JBOSS EAP 5. Any idea what I am missing or if this is possible in JBoss EAP 6.4.


Solution

  • instance-id should be same as node names in worker.loadbalancer.balance_workers. For the above case, we need to run from jboss cli console, following command: e.g: /profile=ha/subsystem=web:write-attribute(name="instance-id",value="node1")