我将apache http服务器配置为使用mod-代理模块充当负载均衡器。
<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/有什么方法可以监视负载平衡器的功能吗?
我的问题是
预先谢谢
发布于 2015-07-13 23:54:09
为了回答您的两个问题,这是可能的,但您需要通过Mod代理增强Apache负载平衡的配置,以使此功能可用。
我建议您使用下面的示例设置:
<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
安装,然后使用上面的配置。
关于可用性,它取决于负载均衡器设置- Round方法-在节点之间平等地共享通信量,并且被认为可能是可用性的最佳选择:
ProxySet lbmethod=byrequests
另外,如果您正在考虑将会话从Apache共享到app服务器,则需要配置AJP而不是HTTP端口,以及应用程序服务器(如Tomcat)上所需的更改。详情可在以下网址查阅:
负载平衡: Apache与物理设备
发布于 2014-11-26 10:21:37
可能太简单了,但是监视平衡器成员的(访问)日志又如何呢?这应该会告诉您,哪个成员正在处理请求。
https://stackoverflow.com/questions/22633953
复制相似问题