views:

66

answers:

1

Hi there,

I am trying to set up a JBoss Cluster with Apache Load Balancing. Basically I have followed the guide from here. No problem faced. The only issue I have would be, how do I access my own application? From the guide, it didnt mention how do I mount my own application.

Here's my environment setup:

  • Windows XP
  • JBoss AS 5.0
  • Apache 2.2.16
  • mod_jk 1.2.30

Here's my properties setting:

httpf.conf

Include conf/mod_jk.conf

mod_jk.conf

LoadModule jk_module modules/mod_jk.so

JkWorkersFile conf/workers.properties

JkLogFile logs/mod_jk.log

JkLogLevel info

JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories

JkRequestLogFormat "%w %V %T"

JkMount /application/* loadbalancer

JkUnMount /application/images/* loadbalancer

JkMountFile conf/uriworkermap.properties

JkShmFile run/jk.shm

<Location /jkstatus> JkMount status Order deny,allow Deny from all Allow from 127.0.0.1 </Location>

workers.properties

worker.list=loadbalancer,status

worker.node1.port=8009

worker.node1.host=10.67.51.129

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

worker.node2.port=8009

worker.node2.host= 10.67.51.64

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

worker.loadbalancer.type=lb

worker.loadbalancer.balance_workers=node1,node2

worker.status.type=status

uriworkermap.properties

/jmx-console=loadbalancer

/jmx-console/*=loadbalancer

/web-console=loadbalancer

/web-console/*=loadbalancer

/admin-console=loadbalancer

/admin-console/*=loadbalancer

/myapp/*=loadbalancer

!/myapp/images/*=loadbalancer

server.xml in JBoss

<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">
<!-- A AJP 1.3 Connector on port 8009 -->
<Connector port="8009" address="${jboss.bind.address}"
  emptySessionPath="true" enableLookups="false" redirectPort="8443" 
  protocol="AJP/1.3" connectionTimeout="600000" maxThreads="200"/>

This is how I start the JBoss

Comp1

run.bat -c all -g DefaultPartition -u 230.0.0.4 -b 10.67.51.129 -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-default

Comp2

run.bat -c all -g DefaultPartition -u 230.0.0.4 -b 10.67.51.64 -Djboss.messaging.ServerPeerID=2 -Djboss.service.binding.set=ports-01

My application name is called JBossDB. When i tired to access 10.67.51.129:8080/JBossDB I am able to launch my application. But if I tried to launch localhost/JBossDB it doesnt load. Note, I am able to launch localhost/admin-console.

I hope I have provided all the necessary info. Please help me out. Thanks

+1  A: 

You forget to add proper address mapping to uriworkermap.properties file or to JkMount options.

In uriworkermap.properties you should put such line:

/JBossDB=loadbalancer
/JBossDB/*=loadbalancer

OR in mod_jk.conf such line:

JkMount /JBossDB loadbalancer
JkMount /JBossDB/* loadbalancer
Lukasz Stelmach
Hey, that works... THANKS!!
Nivek