Vote count:
0
Please find the configuration and let me know if there is anything wrong in my configuration.
Requirement:
1. I have deployed an application two tomcat instances and both application has same context name say 'test'.
2. But one application which is deployed on 9090 port has restservices and another with 8080 doesn't have restservices.
3.So want to route request based on requested url like
http://hostname/test/restservice to tomcat 9090
http://hostname/test/page to tomcat 8080
Issue: It is not working and the request are going to any one of the tomcat irrespective of balancer.
#mod_cluster's modules
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
#configure listener
Listen `x.x.x.x:9999`
#DocumetRoot /var/www
<VirtualHost `x.x.x.x:80`>
<Directory />
Order deny,allow
#Deny from all
Allow from `x.x.x.x`
</Directory>
<Location /mc>
SetHandler mod_cluster-manager
Order deny,allow
#Deny from all
Allow from `x.x.x.x`
</Location>
</VirtualHost>
<VirtualHost `x.x.x.x:9999`>
<Directory />
Order deny,allow
#Deny from all
Allow from `x.x.x.x`
</Directory>
ProxyRequests On
ProxyVia On
ErrorLog logs/application_error.log
LogLevel debug
KeepAliveTimeout 120
MaxKeepAliveRequests 0
EnableMCPMReceive
#CreateBalancers 1
#ManagerBalancerName mod_cluster-manager
ServerAdvertise On
AllowDisplay On
ProxyPass /webBalancer http://ift.tt/1uYriTQ
ProxyPass /restServiceBalancer http://ift.tt/1zauAu1
</VirtualHost>
<Proxy http://balancerwebBalancer>
Order deny,allow
Allow from all
BalancerMember http://`x.x.x.x`:8080 route=tomcat1
</Proxy>
<Proxy http://balancerrestServiceBalancer>
Order deny,allow
Allow from all
BalancerMember http://`x.x.x.x`:9090 route=tomcat2
</Proxy>
#####################################################################
On AppServer
tomcat1:
<Listener className="org.jboss.modcluster.container.catalina.standalone.ModClusterListener"
proxyList="`x.x.x.x:9999`" excludedContexts="ROOT" balancer="webBalancer"/>
tomcat2:
<Listener className="org.jboss.modcluster.container.catalina.standalone.ModClusterListener"
proxyList="`x.x.x.x:9999`" excludedContexts="ROOT" balancer="restServiceBalancer"/>
Thanks,
Srinivas
asked 9 secs ago
Routing request based on context path in mod_cluster
Aucun commentaire:
Enregistrer un commentaire