下载好之后。长这个样子
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