注意:一定保证data和logs目录是干净的,防止生成 cluster UUID 一致导致只能看到一个节点,或启动失败
elasticsearch.yml文件配置,
cluster.name: es-pan
#需要配置变动开始 改1为其他数字
node.name: node-1
path.data: D:elasticsearch estdata-1
path.logs: D:elasticsearch estlogs-1
http.port: 9201
transport.tcp.port: 9301
#需要配置变动结束
network.host: 127.0.0.1
discovery.seed_hosts: ["127.0.0.1:9301","127.0.0.1:9302","127.0.0.1:9303","127.0.0.1:9304"]
cluster.initial_master_nodes: ["127.0.0.1:9301","127.0.0.1:9302","127.0.0.1:9303","127.0.0.1:9304"]
http.cors.enabled: true
http.cors.allow-origin: "*"