gpt4 book ai didi

elasticsearch - Elasticsearch:使用两个节点设置集群

转载 作者:行者123 更新时间:2023-12-02 23:42:58 25 4
gpt4 key购买 nike

我在集群中设置了两个主节点,但仅显示“elastic-master”而不是“elastic-slave”。(未显示第二个节点)。如何解决?
我已经关注了Elasticsearch文档,但没有任何改变!
我的主机文件设置:

sudo nano /etc/hosts
192.168.143.30 elastic-master
192.168.143.23 elastic-slave
我的配置文件:
# ---------------------------------- Cluster ------------------------------
cluster.name: elastic-a

# ------------------------------------ Node -------------------------------
node.name: elastic-master
node.master: true
node.data: true

# ---------------------------------- Network ------------------------------
network.host: 192.168.143.30
http.port: 9200
# --------------------------------- Discovery -----------------------------
discovery.seed_hosts: ["192.168.143.30","192.168.143.23"]
cluster.initial_master_nodes: ["elastic-slave", "elastic-master"]
我的第二个配置文件:
# ---------------------------------- Cluster ------------------------------
cluster.name: elastic-a

# ------------------------------------ Node -------------------------------
node.name: elastic-slave
node.master: true
node.data: true

# ---------------------------------- Network ------------------------------
network.host: 192.168.143.23
http.port: 9200
# --------------------------------- Discovery -----------------------------
discovery.seed_hosts: ["192.168.143.30","192.168.143.23"]
cluster.initial_master_nodes: ["elastic-slave", "elastic-master"]

最佳答案

“首先停止服务(sudo服务elasticsearch停止)。删除数据(sudo rm -rf / var / lib / elasticsearch / *)并重新启动服务(sudo服务elasticsearch重新启动)。现在,一切正常!”
在这里找到答案:
Add nodes to make local cluster Elasticsearch [7.8]

关于elasticsearch - Elasticsearch:使用两个节点设置集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63810517/

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