mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
[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:
parent
39bb0d75e2
commit
847f403bd3
17
.gitattributes
vendored
Normal file
17
.gitattributes
vendored
Normal 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
|
@ -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"]
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user