apache http服务器负载均衡器监控

时间:2014-03-25 11:59:41

标签: apache tomcat proxy load-balancing mod-proxy

我使用mod-proxy模块配置了apache http服务器作为负载均衡器

<Proxy balancer://clusterABCD>
    BalancerMember http://192.168.0.222:8080/geoserver/wms loadfactor=8
    BalancerMember http://192.168.0.14:8081/geoserver/wms loadfactor=8
    BalancerMember http://192.168.0.222:8082/geoserver/wms status=+H
    ProxySet lbmethod=bytraffic
    Order allow,deny
    Allow from all
</Proxy>

ProxyPass /LGroup balancer://clusterABCD/

有没有办法监控负载均衡器功能

我的问题是

  1. 有没有办法找到请求正在处理的BalanceMember
  2. 是否有任何可用于增加功能的设置
  3. 先谢谢

2 个答案:

答案 0 :(得分:0)

可能过于简单,但是如何监控平衡器成员的(访问 - )日志呢?这应该向您显示,哪个成员正在处理请求。

答案 1 :(得分:0)

为了回答您的两个问题,是的,这是可能的,但您需要通过Mod Proxy增强Apache Load Balancing的配置才能使用此功能。

我建议你使用下面的示例设置:

<VirtualHost *:80>
ProxyRequests off

ServerName servername.local

<Proxy balancer://mycluster>
        # TomcatA
        BalancerMember http://172.20.20.101:8080 route=tomcatA
        # TomcatB
        BalancerMember http://172.20.20.102:8080 route=tomcatB
        # TomcatC
        BalancerMember http://172.20.20.103:8080 route=tomcatC


        # Security – to determine who is allowed to access
        # Currently all are allowed to access
        Order Deny,Allow
        Deny from none
        Allow from all

        # Load Balancer Settings
        # We will be configuring a simple Round
        # Robin style load balancer.  This means
        # that all nodes take an equal share of
        # of the load.
        ProxySet lbmethod=byrequests

</Proxy>

# balancer-manager
# This tool is built into the mod_proxy_balancer
# module and will allow you to do some simple
# modifications to the balanced group via a gui
# web interface.
<Location /balancer-manager>
        SetHandler balancer-manager

        # I recommend locking this one down to your
        # administering location
        Order deny,allow
        Allow from all
</Location>

# Point of Balance
# This setting will allow to explicitly name the
# location in the site that we want to be
# balanced, in this example we will balance "/"
# or everything in the site.
ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=Off scolonpathdelim=On

要查看余额申请,您需要拥有模块

  

mod_proxy_balancer的

已安装,然后使用上面的配置。

关于可用性,它取决于负载均衡器设置,循环方法在节点之间平均分配流量,并且被视为可用性的最佳选择:

  

ProxySet lbmethod = byrequests

此外,如果您正在考虑与从Apache到应用服务器的请求共享会话,则需要配置到AJP而不是HTTP端口以及应用服务器(例如Tomcat)上所需的更改。更多详情请访问:

Load Balancing: Apache versus Physical Appliance

相关问题