%define COMPONENT elasticsearch
%define RPM_NAME caas-%{COMPONENT}
-%define RPM_MAJOR_VERSION 7.3.0
-%define RPM_MINOR_VERSION 2
+%define RPM_MAJOR_VERSION 7.4.0
+%define RPM_MINOR_VERSION 0
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
%define centos_build 191001
MAINTAINER Levente Kale <levente.kale@nokia.com>
ARG VERSION
-ENV ES_VERSION=$VERSION
ENV PATH /usr/share/elasticsearch/bin:$PATH
-ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk
+ENV JAVA_HOME /usr/lib/jvm/jre-13-openjdk
ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch"
-ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-oss-${ES_VERSION}-linux-x86_64.tar.gz"
+ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-oss-${VERSION}-linux-x86_64.tar.gz"
WORKDIR /usr/share/elasticsearch
&& adduser -u 202 -g 202 -d /usr/share/elasticsearch elasticsearch \
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum install -y --setopt=skip_missing_names_on_install=False \
- java-1.8.0-openjdk-headless \
+ java-latest-openjdk-headless \
unzip \
which \
coreutils \
COPY elasticsearch-logrotate.sh /etc/cron.hourly/
COPY elasticsearch-setindex.sh /usr/share/elasticsearch/
COPY log4j2.properties /usr/share/elasticsearch/config/
+COPY supervisord.conf /etc/
FS_LIMIT=80
DOCS_DROP=100000
-ES_URL="http://localhost:$ELASTICSEARCH_LOGGING_SERVICE_PORT"
+ES_URL="http://localhost:$ELASTICSEARCH_SERVICE_PORT"
log () {
echo "LOGROTATE: $*" >/proc/1/fd/1
log "hourly job started"
-IFS='-' read es type num <<< "$HOSTNAME"
-if [[ "$type" != "data" ]]; then
- log "non-data node -> exiting"
- exit 0
-fi
-
-# sleep to avoid concurrent runs across multiple ES data Pods
+# sleep to avoid concurrent runs across multiple ES Pods
let "SLEEP=($num * 600)+($RANDOM % 30)"
log "sleeping $SLEEP seconds..."
sleep $SLEEP
ack="false"
while [ "$ack" != "true" ]
do
- response=$(curl -sS -XPUT "http://localhost:$ELASTICSEARCH_LOGGING_SERVICE_PORT/_template/default_template" -H 'Content-Type: application/json' -d'
+ response=$(curl -sS -XPUT "http://localhost:$ELASTICSEARCH_SERVICE_PORT/_template/default_template" -H 'Content-Type: application/json' -d'
{
"index_patterns": ["*"],
"settings": {
--- /dev/null
+[unix_http_server]
+file=/run/supervisord.sock ; (the path to the socket file)
+chmod = 0770
+chown = root:root
+username = dummy
+password = dummy
+
+[supervisord]
+user=root
+logfile=/dev/null
+logfile_maxbytes=0
+loglevel=info
+pidfile=/var/run/supervisor/supervisord.pid
+nodaemon=true
+minfds=1024
+minprocs=200
+
+[supervisorctl]
+serverurl=unix:///run/supervisord.sock
+username = dummy
+password = dummy
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[program:elasticsearch]
+command=/usr/share/elasticsearch/bin/elasticsearch
+user=202
+startsecs=3
+startretries=1
+stopwaitsecs = 3
+priority = 1
+redirect_stderr=true
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+
+[program:crond]
+command=/usr/sbin/crond -n -s
+startsecs=3
+startretries=1
+stopwaitsecs = 3
+priority = 2
+redirect_stderr=true
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+
+[program:setindex]
+command=/usr/share/elasticsearch/elasticsearch-setindex.sh
+startsecs=3
+startretries=1
+stopwaitsecs = 3
+priority = 2
+redirect_stderr=true
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0