Apache 2.2 mod_代理故障切换/负载平衡

Apache 2.2 mod_代理故障切换/负载平衡,apache,load-balancing,mod-proxy,failover,apache2.2,Apache,Load Balancing,Mod Proxy,Failover,Apache2.2,我使用mod_proxy_平衡器来管理后端服务器(tcserver)的故障切换。当其他后端服务(如NFS)出现故障时,后端服务器可能会返回错误代码,而不是超时,我们希望这些服务器也被标记为故障节点。因此,我们使用failonstatus指令 <Proxy balancer://awstestbalancer> ProxySet failonstatus=503 BalancerMember https://host:port/context/ retry=30

我使用mod_proxy_平衡器来管理后端服务器(tcserver)的故障切换。当其他后端服务(如NFS)出现故障时,后端服务器可能会返回错误代码,而不是超时,我们希望这些服务器也被标记为故障节点。因此,我们使用failonstatus指令

<Proxy balancer://awstestbalancer>
    ProxySet failonstatus=503 
    BalancerMember https://host:port/context/ retry=30
    # the hot standby
    BalancerMember https://host:port/context/ status=+H retry=0
</Proxy>
ProxyPass /context balancer://awstestbalancer
ProxyPassReverse /context balancer://awstestbalancer

ProxySet failonstatus=503
平衡员https://host:port/context/ 重试=30
#热备用
平衡员https://host:port/context/ 状态=+H重试=0
代理传递/上下文balancer://awstestbalancer
ProxyPassReverse/contextbalancer://awstestbalancer
目前,故障切换只存在一个小故障。当活动节点出现故障时,用户将收到503错误,从下一个请求中,备用服务器将接管

但我不想一个请求都失败。mod_代理故障切换不能不向客户端返回错误吗?如果活动节点失败,我希望mod_proxy为同一请求尝试备用,而不仅仅是后续请求

我还尝试了以下设置,但它们不起作用。使用Apache2.2.59

<Proxy balancer://awstestbalancer>
BalancerMember https://host:port/context route=tcserver1 loadfactor=1
BalancerMember https://host:port/context route=tcserver2 loadfactor=1
ProxySet lbmethod=bybusyness
ProxySet nofailover=Off
ProxySet stickysession=JSESSIONID
</Proxy>
ProxyPass /context balancer://awstestbalancer
ProxyPassReverse /context balancer://awstestbalancer

平衡员https://host:port/context 路由=tcserver1负载因子=1
平衡员https://host:port/context 路由=tcserver2负载因子=1
ProxySet lbmethod=bybusyness
ProxySet nofailover=关闭
ProxySet stickysession=JSSessionID
代理传递/上下文balancer://awstestbalancer
ProxyPassReverse/contextbalancer://awstestbalancer


平衡员https://host:port/context 路由=tcserver1负载因子=1 ping=5
平衡员https://host:port/context 路由=tcserver2负载因子=1 ping=5
ProxySet lbmethod=bytraffic
ProxySet nofailover=On
ProxySet stickysession=JSSessionID
代理传递/上下文balancer://awstestbalancer
ProxyPassReverse/contextbalancer://awstestbalancer
谢谢
希德
<Proxy balancer://awstestbalancer>
BalancerMember https://host:port/context route=tcserver1 loadfactor=1 ping=5
BalancerMember https://host:port/context route=tcserver2 loadfactor=1 ping=5
ProxySet lbmethod=bytraffic
ProxySet nofailover=On
ProxySet stickysession=JSESSIONID
</Proxy>
ProxyPass /context balancer://awstestbalancer
ProxyPassReverse /context balancer://awstestbalancer

Thanks!!!
Sid