Apache+resin系统按路径分发的实现.docVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Apache+resin系统按路径分发的实现 及其负载均衡中的session机制 适用范围: 当你更改服务器文件路径,但又不想改变用户访问URL时,可以通过Apache 分发指定该路径下的文件由更改后的服务器处理,处理完后返回给Apache,由Apache返回给用户,这样对用户来说就丝毫不受服务器更改的影响。 当一台服务器负载过重时,我们可以考虑采用一台Apache做前端Server,多台resin做后端Server来进行负载均衡。 1、按路径分发 ? 比如有服务器A、B,在A上配有Apache,在B上配有Resin,你想在访问A指定目录时指定由B来处理,那么可以如下配置: 在A中 再配置一个resin.conf,例如叫resin_b.conf, 在 /usr/local/apache/conf/test/resin_b.conf 中配置? srun host=b的内网ip port=b的端口/ ? 然后 apache中如下写就可以了, IfModule mod_caucho.c ? CauchoConfigFile /usr/local/resin/conf/resin.conf ?? Directory /home/httpd/html/smsWeather ????????????? CauchoConfigFile /usr/local/apache/conf/test/resin_b.conf ???? /Directory /IfModule ? 也就是说 访问“/home/httpd/html/smsWeather”这个目录下的东西,apache会使用 /usr/local/apache/conf/test/resin_b.conf的配置。其余的都用/usr/local/resin/conf/resin.conf 补充:在A上必须要有一个B对应目录的结构(在这儿只需要有一个/home/httpd/html/smsWeather目录即可),因为Apache分发的时候需要验证对应的文件是否存在,如果不存在的话就会访问失败。 ? 2、负载均衡 ? 2.1 配置 在/usr/local/apache/conf/test/resin_b.conf中 srun id=b host=host1 port=6802 srun-index=3/ srun id=c host=host2 port=6802 srun-index=1/ 2.2 运行机制: ??? When using Apache or IIS as the webserver, the plugin does the load balancing. It performs the functions of the hardware load balancer or LoadBalanceServlet in the scenarios descriubed above. To understand how Resins load balancing works with plugins, its important to review how the plugin dispatches requests to the backend JVM. The following sequence describes a typical request: Request arrives at web server (i.e. Apache or IIS). Plugin (mod_caucho, mod_isapi, etc) checks if its a Resin request Plugin selects a backend JVM, i.e. a srun If its an old session, send it to the owner JVM. (sticky-sessions) If its a new request, send it to the next srun, using a round-robin policy. Plugin sends the request to the backend JVM with a TCP socket. Plugin receives the response from the backend JVM with the same TCP socket. ??? 这儿涉及到一个关键的概念Sticky Sessions,只要理解了sticky sessions的生成机制,问题基本就解决了。 下面是这段话是Resin在线文档对Sticky sessions的解释。

文档评论(0)

803322fw + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档