Apache+多tomcat组成load balance(tomcat非集群)(

网络整理 - 07-26

下面的balance方案也是基于上面的配置修改的. 简单说一下:

配置apache

  • 启用proxy mod
  • ProxyRequests Off

    <proxy balancer://cluster>

    BalancerMember ajp://localhost:8009 loadfactor=1 route=jvm1

    BalancerMember ajp://localhost:8019 loadfactor=1 route=jvm2

    </proxy>

  • 虚拟主机设置

    <VirtualHost *:80>

    ServerAdmin webmaster@dummy-host3.steel.com

    ServerName localhost

    ServerAlias localhost

    ProxyPass /images !

    ProxyPass /css !

    ProxyPass /js !

    ProxyPass / balancer://cluster/ stickysession=jsessionid nofailover=On

    ProxyPassReverse / balancer://cluster/

    </VirtualHost>