apache+resin集群配置,将指定接口的请求(servlet)转到特定resin的配置
apache+resin集群配置,将指定接口的请求(servlet)转到特定resin的配置。
需求如下:将某个特定url的请求转到特定的后台resin服务器上,其余的请求仍然保持cluster状态
resin2的配置
httpd.conf
<IfModule mod_caucho.c>
<Location /MyServlet*>
CauchoConfigFile conf/resin-test.conf
</Location>
CauchoConfigFile conf/resin-all.conf
</IfModule>
resin-test.conf
<caucho.com>
<http-server>
<srun host=’192.168.1.100′ port=’6800’/>
<servlet-mapping url-pattern=’/MyServlet/*’ servlet-name=’invoker’/>
</http-server>
</caucho.com>
resin-all.conf
<caucho.com>
<http-server>
<srun host=’192.168.1.100′ port=’6800’/>
<srun host=’192.168.1.101′ port=’6800’/>
<servlet-mapping url-pattern=’/servlet/*’ servlet-name=’invoker’/>
<servlet-mapping url-pattern=’*.jsp’ servlet-name=’com.caucho.jsp.JspServlet’/>
</http-server>
</caucho.com>
resin3的配置,相对resin2简单一些,只要在apache中做如下配置:
httpd.conf
<Location /MyServlet* >
ResinConfigServer 192.168.1.100 6800
</Location>
ResinConfigServer 192.168.1.100 6800
ResinConfigServer 192.168.1.101 6800
本文固定链接: https://www.2hei.net/2009/05/06/apache-resin-servlet-to-the-rightone/ | 2hei.net
最活跃的读者