aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorLinPeiWen <591171850@qq.com>2021-04-02 12:00:40 +0000
committerLin PeiWen <591171850@qq.com>2021-04-07 10:05:05 +0000
commit88bf6c71f467c3de48bb66819f5929e75e0e366e (patch)
tree4e4480ebbccb2b4bd073041684c1ac2e5d683397 /docker
parent35affc9fd5102907a6a215e5bbc3cfc8bc26bf86 (diff)
downloadkolla-88bf6c71f467c3de48bb66819f5929e75e0e366e.tar.gz
kolla-88bf6c71f467c3de48bb66819f5929e75e0e366e.zip
Add the healthcheck_rabbitmq script to rabbitmq images
This script is used to check the health check of the rabbitmq container Related patch of kolla-ansible: https://review.opendev.org/c/openstack/kolla-ansible/+/780407 Change-Id: Icbdc9f9686ec1b6f6e1c0ca51ef557b49f32d289
Diffstat (limited to 'docker')
-rw-r--r--docker/rabbitmq/Dockerfile.j29
-rw-r--r--docker/rabbitmq/healthcheck_rabbitmq10
2 files changed, 19 insertions, 0 deletions
diff --git a/docker/rabbitmq/Dockerfile.j2 b/docker/rabbitmq/Dockerfile.j2
index 28c1ef5f6..4b467ec46 100644
--- a/docker/rabbitmq/Dockerfile.j2
+++ b/docker/rabbitmq/Dockerfile.j2
@@ -40,6 +40,15 @@ RUN rm -rf /var/lib/rabbitmq/* \
{% endblock %}
+{% if docker_healthchecks %}
+{% block healthcheck_installation %}
+
+COPY healthcheck_rabbitmq /usr/local/bin/healthcheck_rabbitmq
+RUN chmod 755 /usr/local/bin/healthcheck_rabbitmq
+
+{% endblock %}
+{% endif %}
+
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
diff --git a/docker/rabbitmq/healthcheck_rabbitmq b/docker/rabbitmq/healthcheck_rabbitmq
new file mode 100644
index 000000000..d7a0d54e5
--- /dev/null
+++ b/docker/rabbitmq/healthcheck_rabbitmq
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -e
+
+rabbitmq-diagnostics -q ping || exit 1
+rabbitmq-diagnostics -q status || exit 1
+rabbitmq-diagnostics -q check_running || exit 1
+rabbitmq-diagnostics -q check_local_alarms || exit 1
+rabbitmq-diagnostics -q check_port_connectivity || exit 1
+rabbitmq-diagnostics -q check_virtual_hosts || exit 1