ElasticSearch 7.6.2 Errors reported when deploying three nodes in a single machine

Deployment process:

1. Prepare three elasticsearch servers

Create the elasticsearch-cluster folder and copy the three elasticsearch services internally. You need to delete the data directory in the previous elasticsearch

2. Modify the configuration of each server

Modify the elasticsearch-cluster \ node * \ config \ elasticsearch.yml configuration file

node1 node:

#节点1的配置信息:
#集群名称,保证唯一
cluster.name: my-elasticsearch
#节点名称,必须不一样
node.name: node-1
#必须为本机的ip地址
network.host: 127.0.0.1
#服务端口号,在同一机器下必须不一样
http.port: 9200
#集群间通信端口号,在同一机器下必须不一样
transport.tcp.port: 9300
#设置集群自动发现机器ip集合
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]

 node2 node:

#节点2的配置信息:
#集群名称,保证唯一
cluster.name: my-elasticsearch
#节点名称,必须不一样
node.name: node-2
#必须为本机的ip地址
network.host: 127.0.0.1
#服务端口号,在同一机器下必须不一样
http.port: 9201
#集群间通信端口号,在同一机器下必须不一样
transport.tcp.port: 9301
#设置集群自动发现机器ip集合
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]

 node3 node:

#节点3的配置信息:
#集群名称,保证唯一
cluster.name: my-elasticsearch
#节点名称,必须不一样
node.name: node-3
#必须为本机的ip地址
network.host: 127.0.0.1
#服务端口号,在同一机器下必须不一样
http.port: 9202
#集群间通信端口号,在同一机器下必须不一样
transport.tcp.port: 9302
#设置集群自动发现机器ip集合
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]

3. Start three node nodes respectively, so the error is reported as follows:

master not discovered yet, this node has not previously joined a bootstrapped 
(v7+) cluster,and [cluster.initial_master_nodes] is empty on this node

Means that there is no master node that has not been initialized in the cluster

 

Reasons and solutions:

In version 6 and earlier, there are other options starting with discovery.zen. * That allow you to configure the behavior of Zen Discovery. Some of these settings are no longer valid and have been deleted. Others have been renamed. If a parameter has been renamed, its old name is deprecated in version 7, and you need to adjust the configuration to use the new name.

The new cluster coordination subsystem includes a new fault detection mechanism. This means that Zen Discovery error detection settings beginning with discovery.zen.fd. * Are no longer valid. Most users should use the default fault detection configuration in version 7 or later. If you need to make any changes, you can use cluster.fault_detection.

 

Solution: Modify three yml configuration files

Add this sentence to all three yml configuration files

cluster.initial_master_nodes: ["127.0.0.1:9301","127.0.0.1:9302","127.0.0.1:9303"]

 

Published 108 original articles · praised 48 · 50,000+ views

Guess you like

Origin blog.csdn.net/larry1648637120/article/details/105361767