[Erp5-report] r44113 luke - in /erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5:...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 10 13:53:18 CET 2011


Author: luke
Date: Thu Mar 10 13:53:17 2011
New Revision: 44113

URL: http://svn.erp5.org?rev=44113&view=rev
Log:
 - switch haproxy to http_mode with nice web_based status interface

Modified:
    erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py
    erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/haproxy.cfg.in

Modified: erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py?rev=44113&r1=44112&r2=44113&view=diff
==============================================================================
--- erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py [utf8] (original)
+++ erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/__init__.py [utf8] Thu Mar 10 13:53:17 2011
@@ -136,7 +136,9 @@ class Recipe(BaseSlapRecipe):
 
     self.connection_dict.update(
         haproxy_login=self.installHaproxy(
-          ip=self.getGlobalIPv6Address(), port='15000', name='login', url_list=login_list))
+          ip=self.getGlobalIPv6Address(), port='15000', name='login',
+          url_list=login_list, server_check_path=
+          self.parameter_dict.get('server_check_path', '/erp5/getId')))
     self.connection_dict.update(
         apache_login=self.installLoginApache(ip=self.getGlobalIPv6Address(), port=13000,
         backend=self.connection_dict['haproxy_login']))
@@ -348,9 +350,10 @@ class Recipe(BaseSlapRecipe):
         test_ca_path=CONFIG['ca_dir']
     )
 
-  def installHaproxy(self, ip, port, name, url_list):
-    server_template = """  server %(name)s %(address)s check"""
-    config = dict(name=name, ip=ip, port=port)
+  def installHaproxy(self, ip, port, name, server_check_path, url_list):
+    server_template = """  server %(name)s %(address)s cookie %(name)s check inter 20s rise 2 fall 4"""
+    config = dict(name=name, ip=ip, port=port,
+        server_check_path=server_check_path,)
     i = 1
     server_list = []
     for url in url_list:

Modified: erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/haproxy.cfg.in
URL: http://svn.erp5.org/erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/haproxy.cfg.in?rev=44113&r1=44112&r2=44113&view=diff
==============================================================================
--- erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/haproxy.cfg.in [utf8] (original)
+++ erp5/trunk/utils/slapos.recipe.erp5/src/slapos/recipe/erp5/template/haproxy.cfg.in [utf8] Thu Mar 10 13:53:17 2011
@@ -1,12 +1,26 @@
+global
+  maxconn 4096
+
 defaults
-  mode  tcp
+  log global
+  mode  http
+  option  httplog
+  option  dontlognull
+  retries 1
   option redispatch
+  maxconn 2000
   timeout server 3000s
   timeout queue 5s
   timeout connect 10s
   timeout client 3600s
 
 listen %(name)s %(ip)s:%(port)s
-  option ssl-hello-chk
+  cookie  SERVERID insert
   balance roundrobin
+
 %(server_text)s
+
+  option httpchk GET %(server_check_path)s
+
+  stats uri /haproxy
+  stats realm Global\ statistics



More information about the Erp5-report mailing list