2010-09-22 7 views
1

J'essaie de configurer un cluster JBoss avec l'équilibrage de charge Apache. Fondamentalement, j'ai suivi le guide de here. Aucun problème rencontré. Le seul problème que j'ai, serait, comment puis-je accéder à ma propre application? Du guide, il n'a pas mentionné comment monter ma propre application.Équilibrage de charge JBoss et Apache

Voici ma configuration de l'environnement:

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

Voici mes propriétés mise:

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 dans 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"/> 

Voici comment je commence 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 

Le nom de mon application s'appelle JBossDB. Quand je suis fatigué pour accéder 10.67.51.129:8080/JBossDB je suis capable de lancer mon application. Mais si j'ai essayé de lancer localhost/JBossDB ça ne charge pas. Remarque, je suis capable de lancer localhost/admin-console.

J'espère avoir fourni toutes les informations nécessaires. Sil te plait aide moi. Merci

Répondre

2

Vous oubliez d'ajouter le mappage d'adresse approprié au fichier uriworkermap.properties ou aux options JkMount.

En uriworkermap.properties vous devez mettre cette ligne:

/JBossDB=loadbalancer 
/JBossDB/*=loadbalancer 

OU dans mod_jk.conf cette ligne:

JkMount /JBossDB loadbalancer 
JkMount /JBossDB/* loadbalancer 
+0

Hé, ça marche ... MERCI !! – Nivek

Questions connexes