添加节点以创建本地集群Elasticsearch [7.8] [英] Add nodes to make local cluster Elasticsearch [7.8]

查看:394
本文介绍了添加节点以创建本地集群Elasticsearch [7.8]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Elastic Search(v7.8),所以我做了一个本地集群来对其进行测试。
我使用Ubuntu 18在3个虚拟机上创建了3个虚拟机,资源相同,并且在相同的网络中使用了IP:

I'm learning about Elastic Search (v7.8) so I made a local cluster to test it. I made 3 virtual machines with Ubuntu 18, same amount of resources, in the same network with the IPs:


  • 192.168.1.77

  • 192.168.1.76

  • 192.168.1.75

所有正确的单个安装,每个响应她的API:

All correct individual installation, each respond to her API:

curl -XGET localhost:9200/?pretty

但是当我尝试编辑 /etc/elasticsearch/elasticsearch.yml 的集群时,每个集群都形成自己的同名集群,并带有一个单节点。
这是我的文件: https://gist.github.com/RedxLus/f8eb561157c7f2b61fb4dfaa74fe8868

But when I tried to make a cluster editing /etc/elasticsearch/elasticsearch.yml each forms its own cluster of the same name with a single node. Here my file: https://gist.github.com/RedxLus/f8eb561157c7f2b61fb4dfaa74fe8868

这是每个节点的输出。完全相同。:

Here is the output of each node. Exactly the same.:

curl -XGET 192.168.1.77:9200/_cluster/health?pretty

{
  "cluster_name" : "luisiblog",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

我不知道这是配置错误还是跳过了任何步骤添加节点。我希望他们能帮助我。

I don't know if it is a configuration error or if I have skipped any steps to add the nodes. I hope they help me. Thank you very much to all.

推荐答案

第一件事是您丢失了 network.host 适当的值,该值应为 0.0.0.0 ,以确保该值在非环回地址上可见。

First thing is that you are missing the network.host proper value which should be 0.0.0.0 to make sure this is visible on non-loopback address.

您可以尝试以下配置吗?

Can you try with below configs:

#这是用于节点1

 cluster.name: elasticsearch
    node.name: node-1
    network.host: 0.0.0.0
    discovery.seed_hosts: ["192.168.1.77","192.168.1.76","192.168.1.75"]
    cluster.initial_master_nodes: ["192.168.1.77"]
    discovery.zen.minimum_master_nodes : 1
    node.master: true

#这是用于节点2

cluster.name: elasticsearch
node.name: node-2
network.host: 0.0.0.0
discovery.seed_hosts: ["192.168.1.77","192.168.1.76","192.168.1.75"]
cluster.initial_master_nodes: ["192.168.1.77"]
discovery.zen.minimum_master_nodes : 1
node.master: false

#这是用于节点3的

cluster.name: elasticsearch
node.name: node-3
network.host: 0.0.0.0
discovery.seed_hosts: ["192.168.1.77","192.168.1.76","192.168.1.75"]
cluster.initial_master_nodes: ["192.168.1.77"]
discovery.zen.minimum_master_nodes : 1
node.master: false

请不要让我创建一个专用的主节点,在这种情况下为node-1

这篇关于添加节点以创建本地集群Elasticsearch [7.8]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆