Downgrade Logstash for Monasca

Logstash was added to Kolla as part of the effort to deploy Monasca.

Monasca uses Kafka messaging version 0.9 which is not supported by
Logstash 5.x with the default Kafka input/output plugins. An attempt
to downgrade the plugins to the 4.x series which should be compatible
with messaging version 0.9 and Logstash 5.x failed. Therefore, until
Monasca is upgraded (work is ongoing) this patch downgrades
Logstash to 2.4.1.

Although it would have been simpler to perform the downgrade by
blacklisting the Logstash 5.x package which is provided as part of the
official ELK repo and installing the official repo for Logstash 2.4.1,
Ubuntu 18.04 no longer accepts SHA1 hashes (for good reason) and will
not install Logstash 2.4.1 from this repo (fails with GPG error).
This approach does however work for Centos, but for consistency it
was not used.

This change therefore modifies the Logstash dockerfile, and directly
downloads and installs the Logstash 2.4.1 package. It should be
reverted as soon as Monasca is upgraded.

Partially-Implements: blueprint monasca-containers
Change-Id: I58fba9ceded4b3a198136df084c7d37365ab47a8
This commit is contained in:
Doug Szumski 2018-09-24 11:39:59 +00:00
parent f12b702ca8
commit 0cf2c53450
1 changed files with 27 additions and 3 deletions

View File

@ -9,7 +9,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set logstash_packages = [
'logstash',
'java-1.8.0-openjdk-headless'
] %}
@ -17,8 +16,8 @@ ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk/
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set logstash_packages = [
'logstash',
'openjdk-8-jre-headless'
'openjdk-8-jre-headless',
'logrotate'
] %}
{% if base_arch == 'x86_64' %}
@ -36,6 +35,31 @@ ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-${java_arch}/
{{ macros.install_packages(logstash_packages | customizable("packages")) }}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
# FIXME(dszumski): Logstash was added to Kolla for Monasca. Monasca is
# currently tied to an old messaging version in Kafka (0.9) and doesn't
# work with Logstash 5.x or above. When Monasca is updated to use a more
# recent messaging version this patch should be reverted and the Monasca
# Logstash configuration files upgraded to use the new format.
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
ENV logstash_rpm_url=https://download.elastic.co/logstash/logstash/packages/centos/logstash-2.4.1.noarch.rpm
ENV logstash_rpm_sha1sum=68c5e78c3d941f06f77d638c0756b6aea715bec5
RUN curl -sSL -o /tmp/logstash.rpm ${logstash_rpm_url} \
&& echo "${logstash_rpm_sha1sum} /tmp/logstash.rpm" | sha1sum -c \
&& yum -y install /tmp/logstash.rpm \
&& rm -f /tmp/logstash.rpm
{% elif base_distro in ['debian', 'ubuntu'] %}
ENV logstash_deb_url=https://download.elastic.co/logstash/logstash/packages/debian/logstash-2.4.1_all.deb
ENV logstash_deb_sha1sum=7ba3b174a3ef48a7d0945d9b5c7f12c5005abb47
RUN curl -sSL -o /tmp/logstash.deb ${logstash_deb_url} \
&& echo "${logstash_deb_sha1sum} /tmp/logstash.deb" | sha1sum -c \
&& apt install /tmp/logstash.deb \
&& rm -f /tmp/logstash.deb
{% endif %}
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block logstash_footer %}{% endblock %}