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
This commit is contained in:
LinPeiWen 2021-04-02 12:00:40 +00:00 committed by Lin PeiWen
parent 35affc9fd5
commit 88bf6c71f4
2 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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