Apache http服务器负载均衡器

问题描述 投票:0回答:1

我使用ap-proxy模块将apache http服务器配置为充当负载平衡器,但是当我运行50个并发用户时,负载分布不均。所有请求都将发送到秤服务器1或服务器2。

是否有任何方法可以监视负载平衡器或平均分配负载?

    ProxyRequests off
    Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

    <Proxy balancer://executeeditchecks>

        BalancerMember http://172.50.3.6:9038/executeeditchecks route=server-044
        BalancerMember http://172.50.3.3:9038/executeeditchecks route=server-003
        ProxySet lbmethod=byrequests
        ProxySet stickysession=ROUTEID
    </Proxy>

    <Proxy balancer://editcheckexecution>

        BalancerMember http://172.50.3.6:9038/editcheckexecution route=server-044
        BalancerMember http://172.50.3.3:9038/editcheckexecution route=server-003
        ProxySet lbmethod=byrequests
        ProxySet stickysession=ROUTEID
    </Proxy>

    Listen 7070
    <VirtualHost *:7070>

    ProxyPass /executeeditchecks balancer://executeeditchecks/
    ProxyPassReverse /executeeditchecks balancer://executeeditchecks/

    ProxyPass /editcheckexecution balancer://editcheckexecution/
    ProxyPassReverse /editcheckexecution balancer://editcheckexecution/

    </VirtualHost>
apache proxy load-balancing mod-proxy
1个回答
0
投票

您可以使用balancer manager查看有关平衡器的更多详细信息。

请参见[[启用Balancer Manager支持https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html]

通过添加

<Location "/balancer-manager">
    SetHandler balancer-manager
</Location>

不要忘记为该URL设置访问限制,因为也可以在那里禁用工作程序。

© www.soinside.com 2019 - 2024. All rights reserved.