Compare commits

...

6 Commits

Author SHA1 Message Date
Geoff Bourne
5c14c30a78 [es] Include docker stack deploy instructions 2017-02-02 20:48:17 -06:00
Geoff Bourne
788d06c086 [es] Upgrade to 5.2.0
For #124
2017-02-02 20:28:12 -06:00
Geoff Bourne
1a88c96beb Merged branch master into master 2017-02-02 19:31:11 -06:00
Geoff Bourne
b8d69278e4 [es] Fix address binding for Swarm Mode 2017-01-23 10:25:50 -06:00
Geoff Bourne
4a7ecffcbb [es][kibana] Upgrade to 5.1.2 2017-01-15 07:04:27 -06:00
Geoff Bourne
9fe0021a7a [mc] Upgrade base image to openjdk
Fixes #122
2017-01-12 19:40:58 -06:00
7 changed files with 88 additions and 17 deletions

View File

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

View File

@@ -54,6 +54,24 @@ and then check the cluster health, such as http://192.168.99.100:9200/_cluster/h
"unassigned_shards" : 0 "unassigned_shards" : 0
} }
If you have a Docker Swarm cluster already initialized you can download this
[docker-compose.yml](https://raw.githubusercontent.com/itzg/dockerfiles/master/elasticsearch/docker-compose.yml)
and deploy a cluster using:
docker stack deploy -c docker-compose.yml es
With a `docker service ls` you can confirm 1 master, 2 data, and 1 gateway nodes are running:
```
ID NAME MODE REPLICAS IMAGE
9nwnno8hbqgk es_kibana replicated 1/1 kibana:latest
f5x7nipwmvkr es_gateway replicated 1/1 es
om8rly2yxylw es_data replicated 2/2 es
tdvfilj370yn es_master replicated 1/1 es
```
As you can see, there is also a Kibana instance included and available at port 5601.
# Configuration Summary # Configuration Summary
## Ports ## Ports
@@ -187,20 +205,16 @@ Using the Docker Compose file above, a value of `2` is appropriate when scaling
docker-compose scale master=3 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 When using Docker Swarm mode the container is presented with multiple ethernet
multiple IP addresses. As a result, it creates confusion for the transport publish logic even when using devices. By default, all global, routable IP addresses are configured for
the special value `_eth0_`. 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 -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 -e DISCOVER_HTTP_IP=eth2
## Heap size and other JVM options ## Heap size and other JVM options

View File

@@ -0,0 +1,37 @@
version: '3'
services:
master:
image: itzg/elasticsearch
environment:
TYPE: MASTER
UNICAST_HOSTS: master
MIN_MASTERS: 1
deploy:
replicas: 1
update_config:
parallelism: 1
data:
image: itzg/elasticsearch
environment:
TYPE: DATA
UNICAST_HOSTS: master
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 60s
gateway:
image: itzg/elasticsearch
ports:
- "9200:9200"
- "9300:9300"
environment:
TYPE: GATEWAY
UNICAST_HOSTS: master
kibana:
image: kibana
ports:
- "5601:5601"
environment:
ELASTICSEARCH_URL: http://gateway:9200

View File

@@ -19,6 +19,11 @@ discoverIpFromLink() {
OPTS="$OPTS -E $mode.host=$ip" 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() { setup_clustering() {
if [ -n "$CLUSTER" ]; then if [ -n "$CLUSTER" ]; then
@@ -112,8 +117,13 @@ OPTS="$OPTS \
-E transport.tcp.port=9300 \ -E transport.tcp.port=9300 \
-E http.port=9200" -E http.port=9200"
discoverIpFromLink $DISCOVER_TRANSPORT_IP transport discoverAllGlobalIps
discoverIpFromLink $DISCOVER_HTTP_IP http 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_personality
setup_clustering setup_clustering

View File

@@ -2,7 +2,7 @@ FROM openjdk:8u111-jre
MAINTAINER itzg 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 ADD https://artifacts.elastic.co/downloads/kibana/kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz /tmp/kibana.tgz

View File

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

View File

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