1.主節點配置文件
[root@es_master ~]# cat /home/wx/elasticsearch-7.9.0/config/elasticsearch.yml cluster.name: ELK-Cluster node.name: elk-node1 # 開啟跨域訪問支持,默認為false(不開啟elasticsearch head插件無法鏈接elasticsearch) http.cors.enabled: true # 跨域訪問允許的域名地址(不開啟elasticsearch head插件無法鏈接elasticsearch) http.cors.allow-origin: "*" # 通過為 cluster.initial_master_nodes 參數設置符合主節點條件的節點的 IP 地址來引導啟動集群 cluster.initial_master_nodes: ["elk-node1"] path.data: /home/wx/elasticsearch-7.9.0/data path.logs: /home/wx/elasticsearch-7.9.0/logs bootstrap.memory_lock: true network.host: 0.0.0.0 http.port: 9200 discovery.zen.ping.unicast.hosts: ["192.168.56.30","192.168.56.31"]
2.從節點配置文件
[root@ex_node ~]# cat /home/wx/elasticsearch-7.9.0/config/elasticsearch.yml cluster.name: ELK-Cluster node.name: elk-node2 cluster.initial_master_nodes: ["elk-node1"] path.data: /home/wx/elasticsearch-7.9.0/data path.logs: /home/wx/elasticsearch-7.9.0/logs bootstrap.memory_lock: true network.host: 0.0.0.0 http.port: 9200 discovery.zen.ping.unicast.hosts: ["192.168.56.30","192.168.56.31"]