三台机器elasticsearch.yml配置文件:192.168.125.147、192.168.125.144、192.168.125.142
测试环境:centos7 / elasticsearch7.8
依次启动即可发现其他机器组成集群
注意事项:如果启用报错说找不到其他机器时候,请确认9300端口是否能够互相连通
cluster.name: panco
#node.master: true
#node.data: true
node.name: node-3
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
network.publish_host: 192.168.125.144
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [ "192.168.125.147","192.168.125.142", "192.168.125.144" ]
cluster.initial_master_nodes: [ "node-1","node-2","node-3" ]
xpack.security.enabled: false
cluster.name: panco
#node.master: true
#node.data: true
node.name: node-2
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
network.publish_host: 192.168.125.142
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [ "192.168.125.147","192.168.125.142", "192.168.125.144" ]
cluster.initial_master_nodes: [ "node-1","node-2","node-3" ]
xpack.security.enabled: false
cluster.name: panco
#node.master: true
#node.data: true
node.name: node-1
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 0.0.0.0
network.publish_host: 192.168.125.147
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: [ "192.168.125.147","192.168.125.142", "192.168.125.144" ]
cluster.initial_master_nodes: [ "node-1","node-2","node-3" ]
xpack.security.enabled: false