如何在一个 aws 服务器的集群中添加多个节点?

时间:2021-02-08 08:38:49

标签: elasticsearch cluster-computing

我有一台 aws 服务器。
它有一个名为 mycluster 的集群。并且有一个节点(node-1)。
但是我现在想在一台 aws 服务器中将 node-2,node-3 添加到 mycluster 而不添加新服务器
我想使用 node-1 作为主节点,使用 node-2 和 node-3 作为数据节点。
我应该在下面的 elasticsearch.yml 中添加什么?
还是我必须从另一个文件添加另一个设置?

我目前使用的是 Elasticsearch 7.10.2 版本。
而Java版本如下。
openjdk 11.0.9.1 2020-11-04 OpenJDK 运行时环境(构建 11.0.9.1+1-Ubuntu-0ubuntu1.18.04) OpenJDK 64-Bit Server VM(build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04,混合模式,共享)

enter image description here 我想要这种形式的 Elasticsearch,您可以在上图中看到。

# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: mycluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: "node-1"
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.

0 个答案:

没有答案