[Elasticsearch] Deploy elasticsearch cluster in window environment (4)

前言

Reference documents:

状况描述

The three local es are all started, but when the head is ip+端口connected, which one is connected will be displayed below.
The cerebrosame is true through connection.
下面是我的配置(错误配置示例)

#集群名称,三台集群,要配置相同的集群名称!!!
cluster.name: my-application
#节点名称
node.name: node-3 #是不是有资格主节点
node.master: true
#是否存储数据
node.data: true
#最⼤集群节点数
node.max_local_storage_nodes: 3 #⽹关地址
# 监听地址,用于访问该es
network.host: localhost
#端⼝
http.port: 9202
#内部节点之间沟通端⼝
transport.tcp.port: 9302
#es7.x 之后新增的配置,写⼊候选主节点的设备地址,在开启服务后可以被选为主节点
discovery.seed_hosts: ["localhost:9300", "localhost:9301", "localhost:9302"]
#es7.x 之后新增的配置,初始化⼀个新的集群时需要此配置来选举master
cluster.initial_master_nodes: ["node-1", "node-2","node-3"] #数据和存储路径

path.data: D:\\Elasticsearch\\es-cluster\\elasticsearch-7.8.1_node3\\data
path.logs: D:\\Elasticsearch\\es-cluster\\elasticsearch-7.8.1_node3\\logs

# 是否支持跨域,是:true,在使用head插件时需要此配置
http.cors.enabled: true
# “*” 表示支持所有域名
http.cors.allow-origin: "*"
action.destructive_requires_name: true
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.graph.enabled: false
xpack.watcher.enabled: false
xpack.ml.enabled: false

In the configuration, the ip was changed and changed again, but it was never successful.

解决思路

Because before the es cluster, the zookeeper cluster was built locally in the window, so the path of the data and logs file address is written by referring to that.
I checked a few more articles this morning and found that the addresses inside were all /opt/xxxxxx.Note: the key point, right slash...
There is really no way, so I tried to change the address to this. The modified configuration:

#集群名称,三台集群,要配置相同的集群名称!!!
cluster.name: my-application
#节点名称
node.name: node-3 #是不是有资格主节点
node.master: true
#是否存储数据
node.data: true
#最⼤集群节点数
node.max_local_storage_nodes: 3 #⽹关地址
# 监听地址,用于访问该es
network.host: localhost
#端⼝
http.port: 9202
#内部节点之间沟通端⼝
transport.tcp.port: 9302
#es7.x 之后新增的配置,写⼊候选主节点的设备地址,在开启服务后可以被选为主节点
discovery.seed_hosts: ["localhost:9300", "localhost:9301", "localhost:9302"]
#es7.x 之后新增的配置,初始化⼀个新的集群时需要此配置来选举master
cluster.initial_master_nodes: ["node-1", "node-2","node-3"] #数据和存储路径

path.data: /opt/elasticsearch/data
path.logs: /opt/elasticsearch/logs

# 是否支持跨域,是:true,在使用head插件时需要此配置
http.cors.enabled: true
# “*” 表示支持所有域名
http.cors.allow-origin: "*"
action.destructive_requires_name: true
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.graph.enabled: false
xpack.watcher.enabled: false
xpack.ml.enabled: false

Launch success page
Insert picture description here

After refreshing cerebro, there are three directly displayed below:
Insert picture description here
refreshhead
Insert picture description here

总结

In addition to the conventional configuration, the key point: the path configuration of data and logs. If this configuration is wrong, there is no error prompt when starting

Guess you like

Origin blog.csdn.net/s1441101265/article/details/108096089