Commit 565bfdb4 authored by Łukasz Nowak's avatar Łukasz Nowak

- switch haproxy to http_mode with nice web_based status interface


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44113 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 96bbce49
...@@ -136,7 +136,9 @@ class Recipe(BaseSlapRecipe): ...@@ -136,7 +136,9 @@ class Recipe(BaseSlapRecipe):
self.connection_dict.update( self.connection_dict.update(
haproxy_login=self.installHaproxy( 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( self.connection_dict.update(
apache_login=self.installLoginApache(ip=self.getGlobalIPv6Address(), port=13000, apache_login=self.installLoginApache(ip=self.getGlobalIPv6Address(), port=13000,
backend=self.connection_dict['haproxy_login'])) backend=self.connection_dict['haproxy_login']))
...@@ -348,9 +350,10 @@ class Recipe(BaseSlapRecipe): ...@@ -348,9 +350,10 @@ class Recipe(BaseSlapRecipe):
test_ca_path=CONFIG['ca_dir'] test_ca_path=CONFIG['ca_dir']
) )
def installHaproxy(self, ip, port, name, url_list): def installHaproxy(self, ip, port, name, server_check_path, url_list):
server_template = """ server %(name)s %(address)s check""" 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) config = dict(name=name, ip=ip, port=port,
server_check_path=server_check_path,)
i = 1 i = 1
server_list = [] server_list = []
for url in url_list: for url in url_list:
......
global
maxconn 4096
defaults defaults
mode tcp log global
mode http
option httplog
option dontlognull
retries 1
option redispatch option redispatch
maxconn 2000
timeout server 3000s timeout server 3000s
timeout queue 5s timeout queue 5s
timeout connect 10s timeout connect 10s
timeout client 3600s timeout client 3600s
listen %(name)s %(ip)s:%(port)s listen %(name)s %(ip)s:%(port)s
option ssl-hello-chk cookie SERVERID insert
balance roundrobin balance roundrobin
%(server_text)s %(server_text)s
option httpchk GET %(server_check_path)s
stats uri /haproxy
stats realm Global\ statistics
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment