gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 23:38:11 25 4
gpt4 key购买 nike

我使用 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. 是否有任何可用于增加功能的设置

提前致谢

最佳答案

在回答您的两个问题时,是的,这是可能的,但您需要通过 Mod Proxy 增强 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

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

关于可用性,它取决于负载均衡器设置,轮询方法在节点之间平均共享流量,并且被视为可能是可用性的最佳选择:

ProxySet lbmethod=byrequests

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

Load Balancing: Apache versus Physical Appliance

关于apache http 服务器负载均衡器监控,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22633953/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com