elasticsearch


Elasticsearch 2.0.0 cluster zen discovery in docker


I tried to run the elasticsearch cluster on 2 different nodes of google compute engine in docker way.
With 1.7.1, the unicast works, but with 2.0.0, it didn't work, 2 nodes can not join together.
Below is the Dockerfile, run command and elasticsearch.yml. thanks
Dockerfile
FROM java:8
#ENV ES_PKG_NAME elasticsearch-2.0.0
ENV ES_PKG_NAME elasticsearch-1.7.1
RUN \
cd / && \
#wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.0.0/$ES_PKG_NAME.tar.gz && \
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/$ES_PKG_NAME.tar.gz && \
tar xvzf $ES_PKG_NAME.tar.gz && \
rm -f $ES_PKG_NAME.tar.gz && \
mv /$ES_PKG_NAME /elasticsearch
RUN mkdir -p /data/mnt
RUN chmod 777 -R /data/mnt
RUN chmod 777 -R /elasticsearch
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
USER docker
EXPOSE 9200
EXPOSE 9300
ADD elasticsearch.yml /elasticsearch/config/elasticsearch.yml
ENTRYPOINT ["/elasticsearch/bin/elasticsearch"]
run command
docker run -it -p 9200:9200 -p 9300:9300 \
-v /data/elasticsearch:/data/mnt \
-e ES_HEAP_SIZE=4g \
--restart=always --name elastic_search \
elastic_search \
--node.name=$(hostname) \
--network.publish_host=$(hostname -i) \
--discovery.zen.ping.multicast.enabled=false \
--discovery.zen.ping.unicast.hosts=10.240.0.58:9300,10.240.0.59:9300
elasticsearch.yml
cluster.name: hello
# path
path.conf: /elasticsearch/config
path.data: /data/mnt/data
path.logs: /data/mnt/log
path.plugins: /elasticsearch/plugins
path.work: /data/mnt/work
# index option
index.number_of_shards: 5
index.number_of_replicas: 2
console of node-a
[2015-11-02 04:09:59,133][INFO ][node ] [elastic-a.c.ikalacomputeenginetest.internal] version[2.0.0], pid[1], build[de54438/2015-10-22T08:09:48Z]
[2015-11-02 04:09:59,134][INFO ][node ] [elastic-a.c.ikalacomputeenginetest.internal] initializing ...
[2015-11-02 04:09:59,488][INFO ][plugins ] [elastic-a.c.ikalacomputeenginetest.internal] loaded [license], sites [hq, kopf]
[2015-11-02 04:09:59,523][INFO ][env ] [elastic-a.c.ikalacomputeenginetest.internal] using [1] data paths, mounts [[/data/mnt (/dev/sda9)]], net usable_space [4.5gb], net total_space [6.4gb], spins? [possibly], types [ext4]
[2015-11-02 04:10:01,577][INFO ][node ] [elastic-a.c.ikalacomputeenginetest.internal] initialized
[2015-11-02 04:10:01,577][INFO ][node ] [elastic-a.c.ikalacomputeenginetest.internal] starting ...
[2015-11-02 04:10:01,667][INFO ][transport ] [elastic-a.c.ikalacomputeenginetest.internal] publish_address {10.240.0.58:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2015-11-02 04:10:01,693][INFO ][discovery ] [elastic-a.c.ikalacomputeenginetest.internal] hello/NULtHr65Sm-1d47NfJ_uhQ
[2015-11-02 04:10:04,732][INFO ][cluster.service ] [elastic-a.c.ikalacomputeenginetest.internal] new_master {elastic-a.c.ikalacomputeenginetest.internal}{NULtHr65Sm-1d47NfJ_uhQ}{10.240.0.58}{10.240.0.58:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2015-11-02 04:10:04,812][INFO ][http ] [elastic-a.c.ikalacomputeenginetest.internal] publish_address {10.240.0.58:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2015-11-02 04:10:04,813][INFO ][node ] [elastic-a.c.ikalacomputeenginetest.internal] started
[2015-11-02 04:10:04,904][INFO ][license.plugin.core ] [elastic-a.c.ikalacomputeenginetest.internal] license [b61278f5-5cc8-40b0-87cd-820f1b8d5c58] - valid
console of node-b
[2015-11-02 04:11:34,619][INFO ][node ] [elastic-b.c.ikalacomputeenginetest.internal] version[2.0.0], pid[1], build[de54438/2015-10-22T08:09:48Z]
[2015-11-02 04:11:34,620][INFO ][node ] [elastic-b.c.ikalacomputeenginetest.internal] initializing ...
[2015-11-02 04:11:34,866][INFO ][plugins ] [elastic-b.c.ikalacomputeenginetest.internal] loaded [license], sites [hq, kopf]
[2015-11-02 04:11:34,896][INFO ][env ] [elastic-b.c.ikalacomputeenginetest.internal] using [1] data paths, mounts [[/data/mnt (/dev/sda9)]], net usable_space [4.7gb], net total_space [6.4gb], spins? [possibly], types [ext4]
[2015-11-02 04:11:37,007][INFO ][node ] [elastic-b.c.ikalacomputeenginetest.internal] initialized
[2015-11-02 04:11:37,008][INFO ][node ] [elastic-b.c.ikalacomputeenginetest.internal] starting ...
[2015-11-02 04:11:37,085][INFO ][transport ] [elastic-b.c.ikalacomputeenginetest.internal] publish_address {10.240.0.59:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2015-11-02 04:11:37,108][INFO ][discovery ] [elastic-b.c.ikalacomputeenginetest.internal] hello/DD6mqmC4SC2K3RXx4Dy8xg
[2015-11-02 04:11:40,134][INFO ][cluster.service ] [elastic-b.c.ikalacomputeenginetest.internal] new_master {elastic-b.c.ikalacomputeenginetest.internal}{DD6mqmC4SC2K3RXx4Dy8xg}{10.240.0.59}{10.240.0.59:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2015-11-02 04:11:40,199][INFO ][http ] [elastic-b.c.ikalacomputeenginetest.internal] publish_address {10.240.0.59:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2015-11-02 04:11:40,200][INFO ][node ] [elastic-b.c.ikalacomputeenginetest.internal] started
[2015-11-02 04:11:40,281][INFO ][license.plugin.core ] [elastic-b.c.ikalacomputeenginetest.internal] license [16216eed-f88a-4c59-8578-b1cba069a219] - valid
just ran into the exact same problem : when launching your docker container, you have to change the variable --network.publish_host, as it is now in ES 2.0 network.host : https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html#settings.
This should do the trick !

Related Links

Elasticsearch dies on primary node at random times. What should I look for in troubleshooting?
elasticsearch problems with queries
Normalize elasticsearch query/results
ElasticSearch max shard size
Elasticsearch: Group results of different types in response structure
Storing data in Elasticsearch - OLTP
Elasticsearch + Shield, security_exception happens when Document Level Security is enabled
ElasticSearch Parent/Child Restriction
How to configure kibana for multiple nodes in the same cluster?
Get latest records in elastic search
Put filtered mustache search template on AWS elasticsearch cluster using javascript API
Get Percentage of Values in Elasticsearch
elasticsearch - aggregating counts on array matches
ElasticSearch has_child query does not support query_string
elastic search autocomplete, searching with space creating an issue
(ELK) logstash grok for SBR accounting log

Categories

HOME
magento2
libgdx
mpdf
clearcase
scroll
hid
loopbackjs
plpgsql
theano
ios-simulator
visual-studio-2010
websocket
google-play-services
jersey-2.0
mathematical-optimization
vue-resource
ui-automation
firebase-dynamic-links
specifications
hspi
reportviewer
responsivevoice
mailgun
dma
l20n
mixpanel
gravity
pickle
spam
azure-machine-learning
qa
device
pdf.js
prompt
ccavenue
django-import-export
materialize
basic-authentication
mdns
location-services
infopath2010
progid
mapnik
steam-web-api
rdp
best-buy-api
newtons-method
google-prediction
type-inference
destroy
music21
section508
viewmodel
deployd
uiautomatorviewer
md5-file
sesame
sidewaffle
fitbit
pbx
pjax
metabase
jpda
data-management
jsf-2.3
between
groovyfx
fiber
android-syncadapter
android-async-http
xcopy
gridbaglayout
gravatar
vimperator
jsr363
perceptron
smart-tv
highest
jnlp
blockquote
wlanapi
android-handler
embeddedwebserver
nsmutabledata
mod-auth-openidc
fat32
string.format
lmax
oracle-adf-mobile
windows-messages
jchartfx
jomsocial
armv6
strcmp
acitree
spiral
handshake
tridion-2011
semantic-merge
viewpagerindicator
prefuse
office-automation
kext
azure-acs
qcar-sdk
gaelyk
.net-services
spring-modules
3270
fxruby
downcasting
prism-2
regioninfo
chronic

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile