Add load_balancing config
[pazpar2-moved-to-github.git] / perf / load_balancing / pz2-lb.conf
1 # Pazpar2 load-balancing example using mod_proxy_load_balancer
2 # ==============================================================================
3 # This example uses pazpar2's serverIDs as the load-balancing routes 
4 # to keep pazpar2 sessions sticky.
5 # Pazpar2 serverID can be set in the pazpar2's server config file (server.xml)
6 # by placing an ID attribute on the 'server' element:
7 # <server id="myserver">..</server>
8 <VirtualHost *:80>
9   ServerName satay.index
10   ServerAlias satay 
11
12   LogLevel debug
13   CustomLog /var/log/apache2/pz2-lb-access.log combined
14   ErrorLog /var/log/apache2/pz2-lb-error.log 
15
16   <Proxy *>
17     AddDefaultCharset off
18     Order deny,allow
19     Allow from all
20   </Proxy>
21   ProxyVia Off
22
23   # 'route' has to match the configured pazpar2 server ID
24   <Proxy balancer://pz2cluster>
25     BalancerMember http://localhost:8004 route=metasearch1
26     BalancerMember http://localhost:8005 route=metasearch2
27     BalancerMember http://localhost:8006 route=metasearch3
28     BalancerMember http://localhost:8007 route=metasearch4
29   </Proxy>
30
31   # route is resent in the 'session' param which has the form: 
32   # 'sessid.serverid', understandable by the mod_proxy_load_balancer
33   # this is not going to work if the client tampers with the 'session' param
34   ProxyPass /pazpar2/search.pz2 balancer://pz2cluster lbmethod=byrequests stickysession=session nofailover=On
35
36   # load balancer manager & statistic - for developing and testing only
37   <Location /balancer-manager>
38     SetHandler balancer-manager
39     Order Deny,Allow
40     Deny from all
41   </Location> 
42
43 </VirtualHost>