ELK之elasticsearch7版本集群設置


  ELK7版本搭建參考:https://www.cnblogs.com/minseo/p/10948632.html

  node-1已經安裝配置好  

  配置文件如下

[root@salt-test conf.d]# sed '/#/d' /etc/elasticsearch/elasticsearch.yml 
cluster.name: my-es
node.name: node-1
path.data: /data/es-data
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
#discovery.seed_hosts: ["192.168.1.4", "192.168.1.5"]
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"

  

  新建主機node-2修改elasticsearch配置文件

/etc/elasticsearch/elasticsearch.yml 

  

#集群名需要和node-1一致
cluster.name: my-es
#node名
node.name: node-2
path.data: /data/es-data
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
#集群中兩個節點的IP
discovery.seed_hosts: ["192.168.1.4", "192.168.1.5"]
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"

  啟動elasticsearch

  查看節點1和2

  數據會自動從節點1同步至節點2

  在head查看

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM