[英]Elasticsearch cluster across docker
您如何部署ES(Elasticsearch)集群?
我使用Docker Swarm + Compose部署系統,並嘗試通過.yml部署ES集群:
version: '3.3'
services:
elasticsearch:
image: elasticsearch:alpine
ports:
- '9200:9200'
- '9300:9300'
command: [ elasticsearch, -E, network.host=0.0.0.0, -E, discovery.zen.ping.unicast.hosts=elasticsearch, -E, discovery.zen.minimum_master_nodes=1, -E, cluster.name=mycluster ]
networks:
- esnet1
environment:
ES_JAVA_OPTS: "-Xmx512m -Xms512m"
deploy:
mode: replicated
replicas: 2
#endpoint_mode: dnsrr
resources:
limits:
cpus: '2'
memory: 1024M
reservations:
cpus: '0.50'
memory: 512M
networks:
esnet1:
呼叫請求<ip>:9200/_cat/nodes?v
我看到單個實例。 問題https://github.com/elastic/elasticsearch-docker/issues/91說這是Docker中的錯誤,它將得到修復。 可以,但是沒有群集的ES不是ES! 在Internet中,我看到人們將不同的服務作為主服務器和從服務器進行部署,但這是笨拙的解決方案,因為ES本身確定誰是主服務器,誰不是主服務器,因此勝任。 一個有趣的問題:如何部署ES集群?
這個問題的答案: https : //github.com/elastic/elasticsearch-docker/issues/91#issuecomment-328671018
使用docker 17.09.0-ce-rc1或更高版本
例如: https : //github.com/elastic/elasticsearch-docker/issues/91#issuecomment-330032899
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.