Elasticsearch 集群看不到对方

Elasticsearch Cluster can't see each other

我们在 VMware 管理程序上有 2 Ubuntu 台机器,并且这些机器连接到同一个虚拟交换机。 我在它们上面安装了相同版本的 ElasticSearch (7.6),您可以在下面找到配置:

节点 1:

cluster.name: my_elk
node.name: node-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
transport.host: 192.168.30.14
network.host: [_local_,_site_,_global_]
discovery.seed_hosts: ["192.168.30.15","192.168.30.14"]
cluster.initial_master_nodes: ["node-1", "node-2"]

节点 2:

cluster.name: my_elk
node.name: node-2
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true
transport.host: 192.168.30.15
network.host: [_local_,_site_,_global_]
discovery.seed_hosts: ["192.168.30.15","192.168.30.14"]
cluster.initial_master_nodes: ["node-1", "node-2"]

当启动它们时,它们是分开工作的,并且都有一个活动节点,我已经在一台带有 2 个容器的 Linux 机器上尝试了这些配置,并且可以正常使用自动发现模块。 我的配置有什么问题?

更新: log_file

如果您的两个节点都在独立工作,那么它们各自形成了一个单节点集群,这意味着它们第一次启动时并没有像您显示的那样配置。您不能将这两个单节点集群合并为一个双节点集群。相反,你应该重新开始:擦除它们的数据路径,然后它们将形成一个全新的双节点集群。

参考手册this page的底部有一个说明涉及这个问题:

Elasticsearch will not merge separate clusters together after they have formed, even if you subsequently try and configure all the nodes into a single cluster. This is because there is no way to merge these separate clusters together without a risk of data loss. You can tell that you have formed separate clusters by checking the cluster UUID reported by GET / on each node. If you intended to form a single cluster then you should start again: