resin负载均衡的设置
做个备份Resin 3.1 pro版本中集群与负载均衡的实现
resin1.conf(9.3 K)
resin-web.conf(8.8 K)
resin-313-cluster-app-1.gif(6.8 K)
resin-313-cluster-app-2.gif(6.8 K)
resin-313-cluster-web-1.gif(6.3 K)
切换到幻灯片模式
需要配置前端web层和后端应用层:
1.web层配置:
<!--
- Configuration for the web-tier/load-balancer
-->
<cluster id="web-tier">
<server-default>
<!-- The http port -->
<http address="*" port="80"/>
</server-default>
<server id="web-a" address="127.0.0.1" port="6700"/>
<cache path="cache" memory-size="64M"/>
<host id="">
<web-app id="/">
<rewrite-dispatch>
<load-balance regexp="" cluster="app-tier"/>
</rewrite-dispatch>
</web-app>
</host>
</cluster>
<cluster id="app-tier">
<server id="a" address="127.0.0.1" port="6800"/>
<server id="b" address="127.0.0.1" port="6801"/>
<persistent-store type="cluster">
<init path="cluster"/>
</persistent-store>
<web-app-default>
<session-config>
<use-persistent-store/>
</session-config>
</web-app-default>
<host id="">
...
</host>
</cluster>
以上配置将来自80的请求分发给app-tier应用层集群处理。
2.应用层集群配置:
<!-- define the servers in the cluster -->
<server id="a" address="127.0.0.1" port="6800"/>
<server id="b" address="127.0.0.1" port="6801"/>
3.启动应用层服务器:
D:\resin-pro-3.1.3\httpd.exe -conf conf/resin1.conf -server a
D:\resin-pro-3.1.3\httpd.exe -conf conf/resin1.conf -server b
以上启动了两个应用服务器a和b.
4.启动前端WEB服务器:
1
> D:\resin-pro-3.1.3\httpd.exe -conf conf/resin-web.conf -server web-a
页:
[1]