ES7.3.1
master配置:
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: wali
node.name: master
node.master: true
network.host: 127.0.0.1
slave1配置:
cluster.name: wali
node.name: slave1
network.host: 127.0.0.1
http.port: 8200
discovery.zen.ping.unicast.hosts: ["127.0.0.1"]
我也遇到了 按照7.x新配置
主节点:
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: wali
node.name: master
node.master: true
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["192.168.137.1:9300","192.168.137.1:9301","192.168.137.1:9302"]
cluster.initial_master_nodes: ["master","slave1","slave2"]
从节点
cluster.name: wali
node.name: slave1
node.master: false
node.data: true
network.host: 0.0.0.0
http.port: 9201
discovery.seed_hosts: ["192.168.137.1:9300","192.168.137.1:9301","192.168.137.1:9302"]
cluster.initial_master_nodes: ["master","slave1","slave2"]
http.cors.enabled: true
http.cors.allow-origin: "*"
ip最好用本机ip不要用127.0.0.1 如果把id相同,node不同将data下节点删除重启即可
# 集群名称,处于同一个集群所有节点,该名称必须相同
cluster.name: "liguoxu"
# 节点名称,这儿我直接取名为 slave1
node.name: slave1
# 是否可以成为master节点
node.master: false
# 是否允许该节点存储数据,默认开启
node.data: true
# 网络绑定,这里我绑定 0.0.0.0,支持外网访问
network.host: 0.0.0.0
# 设置对外服务的http端口,默认为9200,这里我们修改为 9201,不然会有端口冲突
http.port: 9201
# 支持跨域访问
http.cors.enabled: true
http.cors.allow-origin: "*"
# 集群发现
discovery.seed_hosts: ["127.0.0.1:9300"]
我也是,后来感觉可能是版本问题所以网上找了个7.4的配置,但是后来发现还是没有,发现要删data目录之后就出来了,你可以试试
没有复制,data也删掉了!