Bug 40910 - configuration problem with more than 1 balancer
Summary: configuration problem with more than 1 balancer
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_balancer (show other bugs)
Version: 2.2.3
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-06 07:00 UTC by Markus Lind
Modified: 2007-09-03 14:01 UTC (History)
0 users



Attachments
Patch against trunk (1.36 KB, patch)
2006-11-06 08:32 UTC, Ruediger Pluem
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Lind 2006-11-06 07:00:17 UTC
When defining more than 1 proxy balancers the system sometimes ignores
configurations and takes the first balancer for all requests. ErrorLog and
configtest say everything is ok, the effect seems to be depending of the order
of configuration

The following configuration doesn't work

<VirtualHost xxx.xxx.xxx.xxx>
    <Proxy balancer://cluster1>
        BalancerMember http://10.x.x.x loadfactor=20 retry=60
        BalancerMember http://10.x.x.y loadfactor=10 retry=60
    </Proxy>
    <Proxy balancer://cluster2>
        BalancerMember http://10.x.x.x:8080 loadfactor=20 retry=60
        BalancerMember http://10.x.x.y:8080 loadfactor=10 retry=60
    </Proxy>
     RewriteEngine on
     RewriteRule ^/specialpath/(.*)$ balancer://cluster2/specialpath/$1 [NC,P,L]
     RewriteRule ^/(.*)$ balancer://cluster1/$1 [P,L]
</VirtualHost>

Every request to specialpath is routed to the webs linked in cluster1
If I change the sequence of the 2 balancers it works

<VirtualHost xxx.xxx.xxx.xxx>
    <Proxy balancer://cluster2>
        BalancerMember http://10.x.x.x:8080 loadfactor=20 retry=60
        BalancerMember http://10.x.x.y:8080 loadfactor=10 retry=60
    </Proxy>
    <Proxy balancer://cluster1>
        BalancerMember http://10.x.x.x loadfactor=20 retry=60
        BalancerMember http://10.x.x.y loadfactor=10 retry=60
    </Proxy>
     RewriteEngine on
     RewriteRule ^/specialpath/(.*)$ balancer://cluster2/specialpath/$1 [NC,P,L]
     RewriteRule ^/(.*)$ balancer://cluster1/$1 [P,L]
</VirtualHost>

Balancer Manager Webpage shows both clusters, but in case 1 the ports of cluster
2 are "lost", in case 2 it is shown correctly with port 8080

With 3 or more backend clusters this issue would be even more complicated to test
Comment 1 Ruediger Pluem 2006-11-06 08:31:35 UTC
Could you please give the attached patch a try? It should fix your problem.
Comment 2 Ruediger Pluem 2006-11-06 08:32:07 UTC
Created attachment 19092 [details]
Patch against trunk
Comment 3 Markus Lind 2006-11-06 09:22:19 UTC
Thanks, the Patch fixes the problem

Comment 4 Ruediger Pluem 2006-12-03 13:26:59 UTC
Committed to trunk as r481901 (http://svn.apache.org/viewvc?view=rev&rev=481901).
Comment 5 Ruediger Pluem 2007-09-02 03:00:42 UTC
Proposed for backport as r571936 (http://svn.apache.org/viewvc?rev=571936&view=rev).
Comment 6 Ruediger Pluem 2007-09-03 14:01:19 UTC
Backported to 2.2.x as r572420 (http://svn.apache.org/viewvc?rev=572420&view=rev).