【问题标题】:Elasticsearch cluster in AWS ECSAWS ECS 中的 Elasticsearch 集群
【发布时间】:2021-08-04 22:05:59
【问题描述】:

我正在尝试在 AWS ECS 中创建弹性搜索集群,但收到警告 "message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes。我的 elasticsearch.yml 和任务定义对于所有节点都是相同的。如何区分主节点和其他节点?我应该为主节点单独定义 elasticsearch.yml/task 吗?

我的 elasticsearch.yml :

cluster.name: "xxxxxxxxxxx"
bootstrap.memory_lock: false
network.host: 0.0.0.0
network.publish_host: _ec2:privateIp_
transport.publish_host: _ec2:privateIp_
discovery.seed_providers: ec2
discovery.ec2.tag.project: xxxxxxx-elasticsearch
discovery.ec2.endpoint: ec2.${REGION}.amazonaws.com
s3.client.default.endpoint: s3.${REGION}.amazonaws.com
cloud.node.auto_attributes: true
cluster.routing.allocation.awareness.attributes: aws_availability_zone
xpack.security.enabled: false

【问题讨论】:

  • 你的elasticsearch.yml 是什么?用它更新你的问题。
  • elasticsearch.yml 在问题中更新

标签: elasticsearch amazon-ecs


【解决方案1】:

我也遇到过类似的问题。首先,您需要创建一个初始集群并准备好形成一个集群。可以通过在 elasticsearch.yml 上使用初始节点配置来开始。我使用的解决方案是托管在一个 ECS 实例上,该实例运行一个 elasticsearch docker 容器(因为 elasticsearch 需要大量内存)

cluster.initial_master_nodes: '<<INITIAL_NODE_IPADDRESS>>'

上述配置启动集群,这意味着 elasticsearch 已准备好加入节点。在下一步中添加以下配置

cluster.initial_master_nodes: [<<MASTER_NODE_IPADDRESS>>,<<INITIAL_NODE_IPADDRESS>>]
discovery.seed_hosts: [<<MASTER_NODE_IPADDRESS>>,<<INITIAL_NODE_IPADDRESS>>]

然后您可以添加任意数量的数据节点。这取决于您拥有多少数据。

注意:IPADDRESS 来自不同的节点,因此请使用 AWS SSM 参数存储安全地存储 IP,并使用 engtrypoint.sh 获取这些信息并在构建 docker 映像时动态更新 elasticsearch.yml 文件。

我希望这能解决问题。

【讨论】:

猜你喜欢
  • 2023-03-30
  • 2018-12-23
  • 2019-12-01
  • 1970-01-01
  • 2018-12-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多