From f2955bcc2fce0cfa2dc9057c3e1664cedbc26da1 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 28 Nov 2016 20:37:44 -0700 Subject: [PATCH] [es] Bump to 5.0.1 * explicitly configure default JVM heap size * /conf needed ownership fixed For #112 --- elasticsearch/Dockerfile | 5 +++-- elasticsearch/README.md | 14 ++++++++++++++ elasticsearch/start | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile index 2c7258d8..f0fb7503 100755 --- a/elasticsearch/Dockerfile +++ b/elasticsearch/Dockerfile @@ -4,7 +4,7 @@ MAINTAINER itzg RUN apk -U add bash -ENV ES_VERSION=5.0.0 +ENV ES_VERSION=5.0.1 ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz RUN cd /usr/share && \ @@ -16,7 +16,8 @@ EXPOSE 9200 9300 ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \ DEFAULT_ES_USER=elasticsearch \ DISCOVER_TRANSPORT_IP=eth0 \ - DISCOVER_HTTP_IP=eth0 + DISCOVER_HTTP_IP=eth0 \ + ES_JAVA_OPTS="-Xms1g -Xmx1g" RUN adduser -S -s /bin/sh $DEFAULT_ES_USER diff --git a/elasticsearch/README.md b/elasticsearch/README.md index d203943f..3aad9c06 100755 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -197,3 +197,17 @@ replacing `eth0` with another interface within the container, if needed. The same can be done for publish/binding of the http module by adding: -e DISCOVERY_HTTP_IP=eth2 + +## Heap size and other JVM options + +By default this image will run Elasticsearch with a Java heap size of 1 GB. If that value +or any other JVM options need to be adjusted, then replace the `ES_JAVA_OPTS` +environment variable. + +For example, this would allow for the use of 16 GB of heap: + + -e ES_JAVA_OPTS="-Xms16g -Xmx16g" + +Refer to [this page](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html) +for more information about why both the minimum and maximum sizes were set to +the same value. diff --git a/elasticsearch/start b/elasticsearch/start index 7ecaccae..c0252667 100755 --- a/elasticsearch/start +++ b/elasticsearch/start @@ -125,7 +125,7 @@ echo "Starting Elasticsearch with the options $OPTS" CMD="$ES_HOME/bin/elasticsearch $OPTS" if [ `id -u` = 0 ]; then echo "Running as non-root..." - chown -R $DEFAULT_ES_USER /data + chown -R $DEFAULT_ES_USER /data /conf su -c "$CMD" $DEFAULT_ES_USER else $CMD