aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-08-07 18:38:43 +0000
committerGerrit Code Review <review@openstack.org>2015-08-07 18:38:43 +0000
commit4811fd72510b23bbda9976918b01370495bcc87b (patch)
tree2714bbb231fed5a1b736e32ee96f972afcb66800
parenta5e907a8e91bc4e1d8f563dc79db0ee96c15d380 (diff)
parent8ede380f1d4d702bf29ea31e6f66dafd8518c759 (diff)
downloadkolla-4811fd72510b23bbda9976918b01370495bcc87b.tar.gz
kolla-4811fd72510b23bbda9976918b01370495bcc87b.zip
Merge "Add check_script for haproxy in keepalived"
-rwxr-xr-xansible/roles/haproxy/tasks/start.yml2
-rwxr-xr-xansible/roles/haproxy/templates/haproxy.cfg.j22
-rw-r--r--ansible/roles/haproxy/templates/keepalived.conf.j23
-rwxr-xr-xdocker/common/keepalived/check_alive.sh7
4 files changed, 8 insertions, 6 deletions
diff --git a/ansible/roles/haproxy/tasks/start.yml b/ansible/roles/haproxy/tasks/start.yml
index cda6c0cf3..ca7150915 100755
--- a/ansible/roles/haproxy/tasks/start.yml
+++ b/ansible/roles/haproxy/tasks/start.yml
@@ -6,6 +6,7 @@
container_privileged: "True"
container_volumes:
- "{{ node_config_directory }}/keepalived/:/opt/kolla/keepalived/:ro"
+ - "/run:/run"
container_environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
@@ -15,6 +16,7 @@
container_name: "haproxy"
container_volumes:
- "{{ node_config_directory }}/haproxy/:/opt/kolla/haproxy/:ro"
+ - "/run:/run"
container_environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2
index 8fc65de14..11a334099 100755
--- a/ansible/roles/haproxy/templates/haproxy.cfg.j2
+++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2
@@ -1,10 +1,10 @@
global
daemon
maxconn 4000
+ stats socket /run/haproxy.sock
defaults
mode http
- maxconn 4000
option redispatch
retries 3
timeout http-request 10s
diff --git a/ansible/roles/haproxy/templates/keepalived.conf.j2 b/ansible/roles/haproxy/templates/keepalived.conf.j2
index e2c37dab5..baba1fda6 100644
--- a/ansible/roles/haproxy/templates/keepalived.conf.j2
+++ b/ansible/roles/haproxy/templates/keepalived.conf.j2
@@ -1,7 +1,8 @@
vrrp_script check_alive {
script "/check_alive.sh"
interval 2
- weight -10
+ fall 2
+ rise 10
}
vrrp_instance Floating {
diff --git a/docker/common/keepalived/check_alive.sh b/docker/common/keepalived/check_alive.sh
index ee0c5a85b..8c2684f10 100755
--- a/docker/common/keepalived/check_alive.sh
+++ b/docker/common/keepalived/check_alive.sh
@@ -1,7 +1,6 @@
#!/bin/bash
-# This is noop check script. Change it to something meaningful.
-# TODO (inc0): When HAProxy is implemented, this should be changed to HAProxy check
-# https://github.com/stackforge/kolla/blob/master/specs/high-availability.rst
+# This will return 0 when it successfully talks to the haproxy daemon via the socket
+# Failures return 1
-exit 0
+echo "show info" | socat unix-connect:/run/haproxy.sock stdio