[es] Fixed #45 with corrected binding and re-worked example

* also upgraded to 2.1.0
* added a MULTICAST env var for supporting networks
This commit is contained in:
Geoff Bourne 2015-11-28 11:35:59 -06:00
parent 39bb0d75e2
commit 847f403bd3
4 changed files with 29 additions and 13 deletions

17
.gitattributes vendored Normal file
View File

@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

View File

@ -2,7 +2,7 @@ FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg
ENV ES_VERSION 2.0.0
ENV ES_VERSION 2.1.0
RUN wget -qO /tmp/es.tgz https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/$ES_VERSION/elasticsearch-$ES_VERSION.tar.gz && \
cd /usr/share && \
@ -23,6 +23,6 @@ USER elasticsearch
EXPOSE 9200 9300
ENV OPTS=-Dnetwork.bind_host=_non_loopback_
ENV OPTS=-Dnetwork.host=_non_loopback_
CMD ["/start"]

View File

@ -31,21 +31,16 @@ http://DOCKERHOST:9200/
Where `DOCKERHOST` would be the actual hostname of your host running
Docker.
# Basic multi-node cluster
# Simple, multi-node cluster
Running a multi-node cluster (3-node in this example) is almost as easy:
To run a multi-node cluster (3-node in this example) on a single Docker machine use:
docker run -d -p 9200:9200 -p 9300:9300 itzg/elasticsearch
docker run -d -p 9201:9200 -p 9301:9300 itzg/elasticsearch
docker run -d -p 9202:9200 -p 9302:9300 itzg/elasticsearch
docker run -d --name es0 -p 9200:9200 es
docker run -d --name es1 --link es0 -e UNICAST_HOSTS=es0 es
docker run -d --name es2 --link es0 -e UNICAST_HOSTS=es0 es
where the only difference was the host port binding of `9200:`/`9300:`,
`9201:`/`9301:`, and `9202:`/`9302:`. By default, Elasticsearch uses
[Zen Discovery](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html), so the three nodes find each other and form a cluster. You
can confirm that by checking the cluster health for the presence of
three nodes (`number_of_nodes`):
http://DOCKERHOST:9200/_cluster/health?pretty
and then check the cluster health, such as http://192.168.99.100:9200/_cluster/health?pretty
{
"cluster_name" : "elasticsearch",

View File

@ -32,6 +32,10 @@ if [ -n "$NODE_NAME" ]; then
OPTS="$OPTS -Des.node.name=$NODE_NAME"
fi
if [ -n "$MULTICAST" ]; then
OPTS="$OPTS -Des.discovery.zen.ping.multicast.enabled=$MULTICAST"
fi
if [ -n "$UNICAST_HOSTS" ]; then
OPTS="$OPTS -Des.discovery.zen.ping.unicast.hosts=$UNICAST_HOSTS"
fi