From 9fe0021a7aa100ed3adfc9e72a4a7ee343ed1ddc Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 12 Jan 2017 19:40:58 -0600 Subject: [PATCH 1/3] [mc] Upgrade base image to openjdk Fixes #122 --- minecraft-server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minecraft-server/Dockerfile b/minecraft-server/Dockerfile index fe28bd34..082bf85f 100644 --- a/minecraft-server/Dockerfile +++ b/minecraft-server/Dockerfile @@ -1,4 +1,4 @@ -FROM java:8 +FROM openjdk:8-jre MAINTAINER itzg From 4a7ecffcbbc83c86ae9e6fc121251fd6e91213fb Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 15 Jan 2017 07:04:27 -0600 Subject: [PATCH 2/3] [es][kibana] Upgrade to 5.1.2 --- elasticsearch/Dockerfile | 2 +- kibana/Dockerfile | 2 +- kibana/docker-compose-test.yml | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 kibana/docker-compose-test.yml diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile index 97ee05f0..eac63e1a 100755 --- a/elasticsearch/Dockerfile +++ b/elasticsearch/Dockerfile @@ -4,7 +4,7 @@ MAINTAINER itzg RUN apk -U add bash -ENV ES_VERSION=5.1.1 +ENV ES_VERSION=5.1.2 ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz RUN cd /usr/share && \ diff --git a/kibana/Dockerfile b/kibana/Dockerfile index 1895029d..7f02dd9c 100755 --- a/kibana/Dockerfile +++ b/kibana/Dockerfile @@ -2,7 +2,7 @@ FROM openjdk:8u111-jre MAINTAINER itzg -ENV KIBANA_VERSION 5.1.1 +ENV KIBANA_VERSION 5.1.2 ADD https://artifacts.elastic.co/downloads/kibana/kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz /tmp/kibana.tgz diff --git a/kibana/docker-compose-test.yml b/kibana/docker-compose-test.yml new file mode 100644 index 00000000..7b484fd1 --- /dev/null +++ b/kibana/docker-compose-test.yml @@ -0,0 +1,12 @@ +version: '2' + +services: + es: + build: ../elasticsearch + ports: + - "9200:9200" + + kibana: + build: . + ports: + - "5601:5601" From b8d69278e4f25b449c0705ed2ff46e9ee649b7c2 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 23 Jan 2017 10:25:50 -0600 Subject: [PATCH 3/3] [es] Fix address binding for Swarm Mode --- elasticsearch/Dockerfile | 2 -- elasticsearch/README.md | 16 ++++++---------- elasticsearch/start | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile index eac63e1a..eb99323b 100755 --- a/elasticsearch/Dockerfile +++ b/elasticsearch/Dockerfile @@ -15,8 +15,6 @@ 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 diff --git a/elasticsearch/README.md b/elasticsearch/README.md index 8ff08c9c..008a0c13 100755 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -182,20 +182,16 @@ Using the Docker Compose file above, a value of `2` is appropriate when scaling docker-compose scale master=3 -## Auto transport/http discovery with Swarm Mode +## Multiple Network Binding, such as Swarm Mode -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_`. +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`. -To resolve this, add +That discovery can be overridden by providing a specific ethernet device name +to `DISCOVER_TRANSPORT_IP` and/or `DISCOVER_HTTP_IP`, such as -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 diff --git a/elasticsearch/start b/elasticsearch/start index c0252667..61e94ccf 100755 --- a/elasticsearch/start +++ b/elasticsearch/start @@ -19,6 +19,11 @@ 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 @@ -112,8 +117,13 @@ OPTS="$OPTS \ -E transport.tcp.port=9300 \ -E http.port=9200" -discoverIpFromLink $DISCOVER_TRANSPORT_IP transport -discoverIpFromLink $DISCOVER_HTTP_IP http +discoverAllGlobalIps +if [ "${DISCOVER_TRANSPORT_IP}" != "" ]; then + discoverIpFromLink $DISCOVER_TRANSPORT_IP transport +fi +if [ "${DISCOVER_HTTP_IP}" != "" ]; then + discoverIpFromLink $DISCOVER_HTTP_IP http +fi setup_personality setup_clustering