From 86782f3e375274cb65dc0b0b7d48450e73e85df3 Mon Sep 17 00:00:00 2001 From: "carey.xu" Date: Fri, 4 Dec 2015 09:40:39 +0800 Subject: database script refactor JIRA: COMPASS-176 Change-Id: I0f87903a94a8072af274d6d5dcf4dd5041f297e6 Signed-off-by: carey.xu --- deploy/adapters/ansible/roles/ha/templates/haproxy.cfg | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'deploy/adapters/ansible/roles/ha') diff --git a/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg b/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg index c8065f05..7b401279 100644 --- a/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg +++ b/deploy/adapters/ansible/roles/ha/templates/haproxy.cfg @@ -25,6 +25,19 @@ defaults timeout check 10s retries 5 +listen proxy-mysql + bind {{ internal_vip.ip }}:3306 + option tcpka + option tcplog + balance source +{% for host, ip in haproxy_hosts.items() %} +{% if loop.index == 1 %} + server {{ host }} {{ ip }}:3306 weight 1 check inter 2000 rise 2 fall 5 +{% else %} + server {{ host }} {{ ip }}:3306 weight 1 check inter 2000 rise 2 fall 5 +{% endif %} +{% endfor %} + listen proxy-glance_registry_cluster bind {{ internal_vip.ip }}:9191 bind {{ public_vip.ip }}:9191 -- cgit 1.2.3-korg