77go负载

其中是开许多resin ,例如:
resin77go-fuzhai.bat中开了四个httpd:
start E:\webtools\resin\httpd.exe -conf E:\webtools\resin\conf\resin77go-fuzhai.conf -server a
start E:\webtools\resin\httpd.exe -conf E:\webtools\resin\conf\resin77go-fuzhai.conf -server b
start E:\webtools\resin\httpd.exe -conf E:\webtools\resin\conf\resin77go-fuzhai.conf -server c
start E:\webtools\resin\httpd.exe -conf E:\webtools\resin\conf\resin77go-fuzhai.conf -server d
在resin77go-fuzhai.conf中
<cluster>
<srun server-id="a" host="127.0.0.1" port="6801"/>
<srun server-id="b" host="127.0.0.1" port="6802"/>
<srun server-id="c" host="127.0.0.1" port="6803"/>
<srun server-id="d" host="127.0.0.1" port="6804"/>
</cluster>

<host id='www.77go.cn'>
<document-directory>D:/77go</document-directory>

<!-- configures the root web-app -->
<web-app id='/'>
<!-- adds xsl to the search path -->
<class-loader>
<compiling-loader path='WEB-INF/classes'/>
<library-loader path='WEB-INF/lib'/>
</class-loader>
</web-app>
</host>

LoadModule caucho_module "E:/webtools/resin/win32/apache-2.0/mod_caucho.dll"
<IfModule mod_caucho.c>
# ResinConfigServer localhost 6811
# CauchoStatus yes
# </IfModule>
# <IfModule mod_caucho.c>
# ResinConfigServer localhost 6812
# CauchoStatus yes
# </IfModule>
# <IfModule mod_caucho.c>
# ResinConfigServer localhost 6813
# CauchoStatus yes
# </IfModule>
# <IfModule mod_caucho.c>
# ResinConfigServer localhost 6814
# CauchoStatus yes
# </IfModule>

#<VirtualHost *:80>
# DocumentRoot D:/77go
# ServerName www.77go.cn
# DirectoryIndex index.jsp index.htm index.html
# Options FollowSymLinks
# ErrorLog D:/77go/logs/www.77go.cn-error_log
# CustomLog D:/77go/logs/access_www.77go.cn.log common
# CustomLog "|bin/cronolog.exe E:/77go_log/%y/%m/%d/access_www.77go.cn.log" combined env=!img-request
# ErrorLog "|bin/cronolog.exe E:/77go_log/%y/%m/%d/error_www.77go.cn.log"
#</VirtualHost>

下面是网上的一篇相关配置:
配置resin负载均衡

下面就简单列出如何配置load balance,以resin 3为例:


配置apache:

假设我开4个cluster,ip分别是10.10.22.1、10.10.22.2、10.10.22.3、10.10.22.4。网卡设置好。在apache的配置文件httpd.conf的最后有3句话:

LoadModule caucho_module /usr/local/apache-mysql/libexec/mod_caucho.so
ResinConfigServer localhost 6802
CauchoStatus yes

只需将第二句改成:

ResinConfigServer 10.10.22.1 6802
ResinConfigServer 10.10.22.2 6802
ResinConfigServer 10.10.22.3 6802
ResinConfigServer 10.10.22.4 6802

resin的配置:

<!-- <http port='80'/> -->

<cluster>
<srun server-id="a" host="10.10.22.1" port="6802" index="1"/> <srun server-id="b" host="10.10.22.2" port="6802" index="2"/> <srun server-id="c" host="10.10.22.3" port="6802" index="3"/> <srun server-id="d" host="10.10.22.4" port="6802" index="4"/> </cluster>

其他根据自己需求配置!

6. 启动resin和apache:由于使用负载均衡技术,因此启动也不单单是起一个http.sh了。可以写一个脚本:

#!/bin/bash
/usr/local/apache/bin/apachectl start
/usr/local/resin/bin/httpd.sh -pid /usr/local/resin/srun1.pid -server a start
/usr/local/resin/bin/httpd.sh -pid /usr/local/resin/srun2.pid -server b start
/usr/local/resin/bin/httpd.sh -pid /usr/local/resin/srun3.pid -server c start
/usr/local/resin/bin/httpd.sh -pid /usr/local/resin/srun4.pid -server d start

对于resin的负载均衡使用上启动的进程数,我认为还是要根据自己的机器实际情况来考虑的。少了达不到效果,多了会机器系统也是一个负载。个人认为,4个可以作为一个默认的选择来考虑。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值