Add load_balancing config
authorJakub Skoczen <jakub@indexdata.dk>
Tue, 26 Jan 2010 14:02:24 +0000 (15:02 +0100)
committerJakub Skoczen <jakub@indexdata.dk>
Tue, 26 Jan 2010 14:02:24 +0000 (15:02 +0100)
perf/load_balancing/pz2-lb.conf [new file with mode: 0644]

diff --git a/perf/load_balancing/pz2-lb.conf b/perf/load_balancing/pz2-lb.conf
new file mode 100644 (file)
index 0000000..a0d7524
--- /dev/null
@@ -0,0 +1,43 @@
+# Pazpar2 load-balancing example using mod_proxy_load_balancer
+# ==============================================================================
+# This example uses pazpar2's serverIDs as the load-balancing routes 
+# to keep pazpar2 sessions sticky.
+# Pazpar2 serverID can be set in the pazpar2's server config file (server.xml)
+# by placing an ID attribute on the 'server' element:
+# <server id="myserver">..</server>
+<VirtualHost *:80>
+  ServerName satay.index
+  ServerAlias satay 
+
+  LogLevel debug
+  CustomLog /var/log/apache2/pz2-lb-access.log combined
+  ErrorLog /var/log/apache2/pz2-lb-error.log 
+
+  <Proxy *>
+    AddDefaultCharset off
+    Order deny,allow
+    Allow from all
+  </Proxy>
+  ProxyVia Off
+
+  # 'route' has to match the configured pazpar2 server ID
+  <Proxy balancer://pz2cluster>
+    BalancerMember http://localhost:8004 route=metasearch1
+    BalancerMember http://localhost:8005 route=metasearch2
+    BalancerMember http://localhost:8006 route=metasearch3
+    BalancerMember http://localhost:8007 route=metasearch4
+  </Proxy>
+
+  # route is resent in the 'session' param which has the form: 
+  # 'sessid.serverid', understandable by the mod_proxy_load_balancer
+  # this is not going to work if the client tampers with the 'session' param
+  ProxyPass /pazpar2/search.pz2 balancer://pz2cluster lbmethod=byrequests stickysession=session nofailover=On
+
+  # load balancer manager & statistic - for developing and testing only
+  <Location /balancer-manager>
+    SetHandler balancer-manager
+    Order Deny,Allow
+    Deny from all
+  </Location> 
+
+</VirtualHost>