我在两台 AWS ec2 机器上进行了以下配置设置。
Machine 10.0.66.123
----------------------
cluster.name: uat-es-cluster
node.name: uat-es-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 10.0.66.123
discovery.seed_hosts: ["10.0.66.106", "10.0.66.123"]
cluster.initial_master_nodes: ["10.0.66.106", "10.0.66.123"]
node.master: true
Machine 10.0.66.106
----------------------
cluster.name: uat-es-cluster
node.name: uat-es-2
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 10.0.66.106
discovery.seed_hosts: ["10.0.66.123", "10.0.66.106"]
cluster.initial_master_nodes: ["10.0.66.106", "10.0.66.123"]
node.master: true
我在两个节点上都得到了以下日志。
[2019-12-30T10:17:19,037][WARN][oeccClusterFormationFailureHelper] [uat-es-2] 尚未发现主节点,此节点之前未加入引导(v7+)集群,此节点必须发现主节点节点 [10.0.66.106, 10.0.66.123] 引导集群:已发现 [{uat-es-2}{DBRJq4uZSJycu7L6vcmZHw}{9k4Ux2veQFiYZcrnHZmFtg}{10.0.66.106}{10.0.66.106:9300}{dilm}{ml.machine_memory =4074115072,xpack.installed=true,ml.max_open_jobs=20}];发现将继续使用来自主机提供商的 [10.0.66.123:9300] 和 [{uat-es-2}{DBRJq4uZSJycu7L6vcmZHw}{9k4Ux2veQFiYZcrnHZmFtg}{10.0.66.106}{10.0.66.106:9300}{dilm}{ml.machine_memory=4074115072 , xpack.installed=true, ml.max_open_jobs=20}] 来自上次已知的集群状态;节点术语 0,术语 0 中最后接受的版本 0