下载好之后。长这个样子

master节点
注意点
1-cluster.name 所有节点要一致
2-node.name,每个节点名字不一样。
3-端口号。每个节点各自给一个,不能一样
cluster.name: my-application
node.name: node-1
node.master: true
node.data: true
network.host: localhost
http.port: 9200
#tcp 监听端口
transport.tcp.port: 9301
#跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
node-2节点
cluster.name: my-application
node.name: node-2
node.master: true
node.data: true
network.host: localhost
http.port: 9201
#tcp 监听端口
transport.tcp.port: 9302
# 发现其他节点
discovery.seed_hosts: ["localhost:9301"]
discovery.zen.fd.ping_timeout: 1m
discovery.zen.fd.ping_retries: 5
#跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
node-3
cluster.name: my-application
node.name: node-3
node.master: true
node.data: true
network.host: localhost
http.port: 9202
#tcp 监听端口
transport.tcp.port: 9303
# 发现其他节点
discovery.seed_hosts: ["localhost:9301","localhost:9302"]
discovery.zen.fd.ping_timeout: 1m
discovery.zen.fd.ping_retries: 5
#跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
测试
三个都启动
http://127.0.0.1:9200/_cluster/health

本文档详细介绍了Elasticsearch集群的配置步骤,包括master节点、node-2和node-3的配置。每个节点的cluster.name需统一,node.name需唯一,端口号不能冲突。此外,http和tcp端口、跨域配置、节点间的发现设置等关键参数也进行了说明。确保正确配置后,启动所有节点,可以通过http://127.0.0.1:9200/_cluster/health进行健康检查。
1764

被折叠的 条评论
为什么被折叠?



