码头集装箱集群中的弹性搜索 [英] Elasticsearch in docker container cluster

查看:96
本文介绍了码头集装箱集群中的弹性搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在2个不同的主机上运行2个ElasticSeach实例。我已经建立了基于Ubuntu 14.04和1.3.2版本的弹性搜索的自己的码头图像。如果我在1个主机上运行2个ES'容器,每个实例看到另一个主机,并且可以通信,但是当我在2个不同的主机上运行2个ES实例时,它没有工作。容器的9300端口绑定到9300主机的端口。



我的问题是:可以使用我的配置创建一个ES'集群?



最好的问候,
Lucas Rival

解决方案

我能够得到聚类在两个Docker主机上使用单播。我刚刚使用 ehazlett / elasticsearch 图像,但我不认为这应该是重要的。真正重要的一点似乎是将 network.publish_host 设置为公共或可路由的IP其Docker主机。



配置






docker-host-01



  eth0:192.168.1.10 
Docker版本1.4.1,build 5bc2ff8 / 1.4.1



docker-host-02



  eth0:192.168.1.20 
Docker版本1.4.1 ,构建5bc2ff8 / 1.4.1



构建集群






Docker Host 01



  docker run -d \ 
-p 9200:9200 \
-p 9300:9300 \
ehazlett / elasticsearch \
--cluster.name = unicast \
- 网络.publish_host = 192.168.1.10 \
--discovery.zen.ping.multicast.enabled = false \
--discovery.zen.ping.unicast.hosts = 192.168.1.20 \
--discovery.zen.ping.timeout = 3s \
--discovery.zen.minimum_master_n odes = 1



Docker Host 02



  docker run -d \ 
-p 9200:9200 \
-p 9300:9300 \
ehazlett / elasticsearch \
--cluster.name = unicast \
--network.publish_host = 192.168.1.20 \
--discovery.zen.ping.multicast.enabled = false \
- discovery.zen.ping.unicast.hosts = 192.168.1.10 \
--discovery.zen.ping.timeout = 3s \
--discovery.zen.minimum_master_nodes = 1


I want to run 2 instance of ElasticSeach on 2 differents hosts. I have build my own docker image based on Ubuntu 14.04 and the 1.3.2 version of elasticsearch. If I run 2 ES' container on 1 host each instance see the other one and can communicate, but when I run 2 instance of ES on 2 differents host it's didn't work. The 9300 port of the container is bind to the 9300 host's port.

My question is : it's possible to create an ES' cluster with my configuration ?

Best regards, Lucas Rival

解决方案

I was able to get clustering working using unicast across two docker hosts. I just happen to be using the ehazlett/elasticsearch image, but I do not think this should matter all that much. The really important bit seems to be setting the network.publish_host setting to a public or routable IP its docker host.

Configuration


docker-host-01

eth0: 192.168.1.10
Docker version 1.4.1, build 5bc2ff8/1.4.1

docker-host-02

eth0: 192.168.1.20
Docker version 1.4.1, build 5bc2ff8/1.4.1

Building the Cluster


On Docker Host 01

docker run -d \
  -p 9200:9200 \
  -p 9300:9300 \
  ehazlett/elasticsearch \
  --cluster.name=unicast \
  --network.publish_host=192.168.1.10 \
  --discovery.zen.ping.multicast.enabled=false \
  --discovery.zen.ping.unicast.hosts=192.168.1.20 \
  --discovery.zen.ping.timeout=3s \
  --discovery.zen.minimum_master_nodes=1

On Docker Host 02

docker run -d \
  -p 9200:9200 \
  -p 9300:9300 \
  ehazlett/elasticsearch \
  --cluster.name=unicast \
  --network.publish_host=192.168.1.20 \
  --discovery.zen.ping.multicast.enabled=false \
  --discovery.zen.ping.unicast.hosts=192.168.1.10 \
  --discovery.zen.ping.timeout=3s \
  --discovery.zen.minimum_master_nodes=1

这篇关于码头集装箱集群中的弹性搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆