gpt4 book ai didi

elasticsearch - Docker中的ElasticSearch群集始终在3个节点的配置中关闭一个主机

转载 作者:行者123 更新时间:2023-12-02 22:29:46 25 4
gpt4 key购买 nike

我在以下三个Docker容器docker-compose.yml中运行elasticsearch cluster。

当我运行它们中的任意两个时,可以设置群集的状态为绿色,但是当我启动第三个时,群集中的一个节点被强制关闭(docker容器退出),并且没有错误消息记录在关闭elasticsearch节点。

节点1 docker-compose.yml:

version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.1
container_name: elasticsearch1
environment:
- cluster.name=MoquiElasticSearch
- bootstrap.memory_lock=true
- discovery.zen.minimum_master_nodes=2
- xpack.security.enabled=false
- transport.publish_host=192.168.2.101
- http.publish_host=192.168.2.101
- discovery.zen.ping.unicast.hosts=192.168.2.101:9301,192.168.2.101:9302
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- TZ=Asia/Shanghai
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
ports:
- 9200:9200
- 9300:9300

节点2 docker-compose.yml
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.1
container_name: elasticsearch2
environment:
- cluster.name=MoquiElasticSearch
- bootstrap.memory_lock=true
- discovery.zen.minimum_master_nodes=2
- xpack.security.enabled=false
- transport.publish_host=192.168.2.101
- transport.publish_port=9301
- transport.tcp.port=9301
- http.publish_host=192.168.2.101
- http.publish_port=9201
- http.port=9201
- discovery.zen.ping.unicast.hosts=192.168.2.101:9300,192.168.2.101:9302
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- TZ=Asia/Shanghai
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
ports:
- 9201:9201
- 9301:9301

节点3 docker-compose.yml
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.1
container_name: elasticsearch3
environment:
- cluster.name=MoquiElasticSearch
- bootstrap.memory_lock=true
- discovery.zen.minimum_master_nodes=2
- xpack.security.enabled=false
- transport.publish_host=192.168.2.101
- transport.publish_port=9302
- transport.tcp.port=9302
- http.publish_host=192.168.2.101
- http.publish_port=9202
- http.port=9202
- discovery.zen.ping.unicast.hosts=192.168.2.101:9300,192.168.2.101:9301
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- TZ=Asia/Shanghai
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
ports:
- 9202:9202
- 9302:9302

最佳答案

这是由于Mac上的docker具有内存限制(以前为2.5G)导致它无法承受3个节点,因此其中之一被迫关闭。

在为docker引擎增加专用内存后,所有3个节点均已启动并正在运行,elasticsearch集群为GREEN

关于elasticsearch - Docker中的ElasticSearch群集始终在3个节点的配置中关闭一个主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45808551/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com