# 需要配置的參數
cluster.name: uap 必須相同 node.name: uap-server 不同 network.host: 172.17.6.29 作用? discovery.zen.ping.unicast.hosts: ["172.17.6.27", "172.17.6.28", "172.17.6.29"] node.master: true node.data: true discovery.zen.minimum_master_nodes: 3 http.cors.enabled: true http.cors.allow-origin: "*"
#注:es版本是5.6.16
network.host
作用: 是network.bind_host和network.publish_host的合並,其中
network.bind_host:指定該節點將綁定到該主機名或IP地址
network.publish_host:設置其他節點連接此節點的地址
值可以是數組形式
節點的角色
# 主節點&數據節點,不建議使用 node.master: true node.data: true # 主節點,索引和集群控制 node.master: true node.data: false # 數據節點,只存儲數據 node.master: false node.data: true # client節點,針對海量請求的時候可以進行負載均衡 node.master: false node.data: false
參考:
https://www.cnblogs.com/37yan/p/9928748.html
https://my.oschina.net/u/2449787/blog/1635447
discovery.zen.minimum_master_nodes
為了避免腦裂,集群節點數最少為 半數取整 + 1