0

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

Nivek
  • 149
  • 1
  • 2
  • 8
  • In your config, did you actually get jkstatus to work? In mine, I am unable to get the jk status app to work unless it is not load balanced by apache and its a static proxy instead. – djangofan May 10 '11 at 16:14

1 Answers1

0

In your uriworkermap.properties file, it does not appear you have a mapping for /JBossDB

micah
  • 974
  • 6
  • 11
  • Hi, thanks for the reply.. I do the changes.. not too sure if i change it correctly.. i change the /myapp/*=loadbalancer !/myapp/images/*=loadbalancer to /JBossDB/*=loadbalancer !/JBossDB/images/*=loadbalancer But i am still unable to access it. Did i change correctly?? By the way.. under the Apache error log [Thu Sep 23 10:21:21 2010] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/JBossDB Must i put my application in that folder?? – Nivek Sep 23 '10 at 02:27
  • Hi, I managed to get it working.. Basically if i access by localhost/JBossDB it doesnt work. But if i try localhost/JBossDB/, with an extra back slash at end, it works... No idea y... – Nivek Sep 24 '10 at 00:31