Skip to content

Commit bb8c6f1

Browse files
committed
es heap option control
1 parent feb78cb commit bb8c6f1

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ RUN cd /toolbox && \
2323
ln -s elasticsearch-${ES_VERSION} elasticsearch && \
2424
chown -R elasticsearch elasticsearch-${ES_VERSION}
2525

26+
# our entrypoint.sh sets and can override this
27+
RUN sed -i '/-Xm[xs]/s/^/#/' /toolbox/elasticsearch/config/jvm.options
28+
2629
RUN cd /toolbox && \
2730
curl -O https://artifacts.elastic.co/downloads/kibana/kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz && \
2831
tar -xvf kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz && \

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ docker run --rm -ti -p 5601:5601 \
381381
analyze-only
382382
```
383383

384+
Want to control the default ElasticSearch JVM memory heap options you can do so via
385+
a docker environment variable i.e. `-e ES_JAVA_OPTS="-Xmx1g -Xms1g"` etc.
386+
384387
## <a id="help"></a>Help/Resources
385388

386389
### Gmail

entrypoint.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#!/bin/bash
22

3+
if [ -z "$ES_JAVA_OPTS" ]; then
4+
# if not set just use ES defaults (that were formally in jvm.options see Dockerfile)
5+
export ES_JAVA_OPTS="-Xmx2g -Xms2g"
6+
else
7+
echo
8+
echo "using: ES_JAVA_OPTS=$ES_JAVA_OPTS"
9+
fi
10+
11+
312
echo
413
echo "Starting ElasticSearch.... please wait"
514
echo
6-
su -c "nohup /toolbox/elasticsearch/bin/elasticsearch -d -Enetwork.host=0.0.0.0 &>/toolbox/elasticsearch/elasticsearch.log &" -s /bin/bash elasticsearch
15+
su -c "export ES_JAVA_OPTS='$ES_JAVA_OPTS'; nohup /toolbox/elasticsearch/bin/elasticsearch -d -Enetwork.host=0.0.0.0 &>/toolbox/elasticsearch/elasticsearch.log &" -s /bin/bash elasticsearch
716
sleep 10
817
timeout 30 tail -f /toolbox/elasticsearch/logs/elasticsearch.log
918

@@ -63,6 +72,12 @@ else
6372
echo
6473
fi
6574

75+
echo
76+
echo "ElasticSearch and Kibana processes....."
77+
ps aux | grep 'java\|kibana'
78+
79+
echo
80+
echo
6681
echo "In your web browser go to http://localhost:5601"
6782
echo ""
6883
echo "On the first screen that says 'Configure an index pattern', in the field labeled 'Index name or pattern' type 'mbox'"

0 commit comments

Comments
 (0)