[jamespage, r=thedac] Fixup for newer haproxy, actually use timeouts from configuration

This commit is contained in:
David Ames 2016-02-19 09:02:30 -08:00
commit ebc4ca57ca
5 changed files with 28 additions and 9 deletions

View File

@ -217,4 +217,3 @@ options:
description: |
Connect timeout configuration in ms for haproxy, used in HA
configurations. If not provided, default value of 5000ms is used.

View File

@ -141,7 +141,10 @@ CONFIG_FILES = OrderedDict([
'services': ['apache2'],
}),
(HAPROXY_CONF, {
'hook_contexts': [horizon_contexts.HorizonHAProxyContext()],
'hook_contexts': [
horizon_contexts.HorizonHAProxyContext(),
context.HAProxyContext(singlenode_mode=True),
],
'services': ['haproxy'],
}),
(ROUTER_SETTING, {

View File

@ -1,6 +1,6 @@
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
log {{ local_host }} local0
log {{ local_host }} local1 notice
maxconn 20000
user haproxy
group haproxy
@ -12,23 +12,40 @@ defaults
option tcplog
option dontlognull
retries 3
timeout queue 1000
timeout connect 1000
{%- if haproxy_queue_timeout %}
timeout queue {{ haproxy_queue_timeout }}
{%- else %}
timeout queue 5000
{%- endif %}
{%- if haproxy_connect_timeout %}
timeout connect {{ haproxy_connect_timeout }}
{%- else %}
timeout connect 5000
{%- endif %}
{%- if haproxy_client_timeout %}
timeout client {{ haproxy_client_timeout }}
{%- else %}
timeout client 30000
{%- endif %}
{%- if haproxy_server_timeout %}
timeout server {{ haproxy_server_timeout }}
{%- else %}
timeout server 30000
{%- endif %}
listen stats :8888
listen stats
bind {{ local_host }}:{{ stat_port }}
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth admin:password
stats auth admin:{{ stat_password }}
{% if units %}
{% for service, ports in service_ports.iteritems() -%}
listen {{ service }}
bind 0.0.0.0:{{ ports[0] }}
bind *:{{ ports[0] }}
{% if prefer_ipv6 -%}
bind :::{{ ports[0] }}
{%- endif %}

0
tests/019-basic-trusty-mitaka Normal file → Executable file
View File

0
tests/021-basic-xenial-mitaka Normal file → Executable file
View File