Compare commits

..

1 Commits

Author SHA1 Message Date
Geoff Bourne
262816bd2d [es] Add note about increasing mmap count 2017-01-04 20:43:23 -06:00
6 changed files with 22 additions and 33 deletions

View File

@@ -4,7 +4,7 @@ MAINTAINER itzg
RUN apk -U add bash
ENV ES_VERSION=5.1.2
ENV ES_VERSION=5.1.1
ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz
RUN cd /usr/share && \
@@ -15,6 +15,8 @@ EXPOSE 9200 9300
ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \
DEFAULT_ES_USER=elasticsearch \
DISCOVER_TRANSPORT_IP=eth0 \
DISCOVER_HTTP_IP=eth0 \
ES_JAVA_OPTS="-Xms1g -Xmx1g"
RUN adduser -S -s /bin/sh $DEFAULT_ES_USER

View File

@@ -1,5 +1,10 @@
This Docker image provides an easily configurable Elasticsearch node. Via port mappings, it is easy to create an arbitrarily sized cluster of nodes. As long as the versions match, you can mix-and-match "real" Elasticsearch nodes with container-ized ones.
# NOTE for use on Linux hosts
Elasticsearch 5.x requires that the virtual memory mmap count is set sufficiently for stable,
production use. [Refer to this guide for more information](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html).
# Basic Usage
To start an Elasticsearch data node that listens on the standard ports on your host's network interface:
@@ -182,16 +187,20 @@ Using the Docker Compose file above, a value of `2` is appropriate when scaling
docker-compose scale master=3
## Multiple Network Binding, such as Swarm Mode
## Auto transport/http discovery with Swarm Mode
When using Docker Swarm mode the container is presented with multiple ethernet
devices. By default, all global, routable IP addresses are configured for
Elasticsearch to use as `network.host`.
When using Docker Swarm mode (starting with 1.12), the overlay and ingress network interfaces are assigned
multiple IP addresses. As a result, it creates confusion for the transport publish logic even when using
the special value `_eth0_`.
That discovery can be overridden by providing a specific ethernet device name
to `DISCOVER_TRANSPORT_IP` and/or `DISCOVER_HTTP_IP`, such as
To resolve this, add
-e DISCOVER_TRANSPORT_IP=eth0
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 DISCOVER_HTTP_IP=eth2
## Heap size and other JVM options

View File

@@ -19,11 +19,6 @@ discoverIpFromLink() {
OPTS="$OPTS -E $mode.host=$ip"
}
discoverAllGlobalIps() {
ips=`ipaddr show scope global|awk '$1 == "inet" { if (!match($2,"/32")) { gsub("/.*","",$2) ; addrs[length(addrs)] = $2 } } END { for (i in addrs) { if (i>0) printf "," ; printf addrs[i] } }'`
OPTS="$OPTS -E network.host=$ips"
}
setup_clustering() {
if [ -n "$CLUSTER" ]; then
@@ -117,13 +112,8 @@ OPTS="$OPTS \
-E transport.tcp.port=9300 \
-E http.port=9200"
discoverAllGlobalIps
if [ "${DISCOVER_TRANSPORT_IP}" != "" ]; then
discoverIpFromLink $DISCOVER_TRANSPORT_IP transport
fi
if [ "${DISCOVER_HTTP_IP}" != "" ]; then
discoverIpFromLink $DISCOVER_HTTP_IP http
fi
discoverIpFromLink $DISCOVER_TRANSPORT_IP transport
discoverIpFromLink $DISCOVER_HTTP_IP http
setup_personality
setup_clustering

View File

@@ -2,7 +2,7 @@ FROM openjdk:8u111-jre
MAINTAINER itzg
ENV KIBANA_VERSION 5.1.2
ENV KIBANA_VERSION 5.1.1
ADD https://artifacts.elastic.co/downloads/kibana/kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz /tmp/kibana.tgz

View File

@@ -1,12 +0,0 @@
version: '2'
services:
es:
build: ../elasticsearch
ports:
- "9200:9200"
kibana:
build: .
ports:
- "5601:5601"

View File

@@ -1,4 +1,4 @@
FROM openjdk:8-jre
FROM java:8
MAINTAINER itzg