版本:elasticSearch7.9.2 系统:centos7 机器:3台,例 192.168.1.106, 192.168.1.107, 192.168.1.108
搭建过程参考之前的文章 , 搭建ELK分布式日志采集系统,分别在3台机器部署
修改3台机器的配置,例如 192.168.1.106
# ---------------------------------- Cluster ----------------------------------- # ... cluster.name: cbos2.1-elasticsearch # ... node.name: node-106 # ... path.data: /usr/local/elk_7.9.2/elasticsearch/elasticsearch-7.9.2/data path.logs: /usr/local/elk_7.9.2/elasticsearch/elasticsearch-7.9.2/logs network.host: 0.0.0.0 # ... http.port: 9200 # ... discovery.seed_hosts: ["192.168.1.106","192.168.1.107","192.168.1.108"] # ... cluster.initial_master_nodes: ["node-106"]192.168.1.107
# ---------------------------------- Cluster ----------------------------------- # ... cluster.name: cbos2.1-elasticsearch # ... node.name: node-107 # ... path.data: /usr/local/elk_7.9.2/elasticsearch/elasticsearch-7.9.2/data path.logs: /usr/local/elk_7.9.2/elasticsearch/elasticsearch-7.9.2/logs network.host: 0.0.0.0 # ... http.port: 9200 # ... discovery.seed_hosts: ["192.168.1.106","192.168.1.107","192.168.1.108"] # ... cluster.initial_master_nodes: ["node-106"]192.168.1.108
# ---------------------------------- Cluster ----------------------------------- # ... cluster.name: cbos2.1-elasticsearch # ... node.name: node-108 # ... path.data: /usr/local/elk_7.9.2/elasticsearch/elasticsearch-7.9.2/data path.logs: /usr/local/elk_7.9.2/elasticsearch/elasticsearch-7.9.2/logs network.host: 0.0.0.0 # ... http.port: 9200 # ... discovery.seed_hosts: ["192.168.1.106","192.168.1.107","192.168.1.108"] # ... cluster.initial_master_nodes: ["node-106"]启动成功后在浏览器输入 http://192.168.1.106:9200/_cat/nodes
结果如下即为成功
使用kibana运行如下api
PUT _cluster/settings { "persistent": { "xpack.monitoring.collection.enabled": true } }打开kibana左侧菜单的堆栈检测,出现如下页面即为成功