新開一台伺服器,做客戶端
安裝 node_exporter 收集資料systemctl stop firewalld.service
setenforce 0
服務端新增配置檔案[root@pre3 ~
]# tar zxf node_exporter-
0.18
.1.linux-amd64.tar.gz
[root@pre3 ~
]# ls
anaconda-ks.cfg node_exporter-
0.18
.1.linux-amd64.tar.gz
node_exporter-
0.18
.1.linux-amd64
[root@pre3 ~
]# mv node_exporter-
0.18
.1.linux-amd64 /usr/local/node_exporter
[root@pre3 ~
]# cd /usr/local/node_exporter
[root@pre3 node_exporter]# ls
license node_exporter notice
[root@pre3 node_exporter]# cp node_exporter /usr/local/bin/
[root@pre3 node_exporter]# node_exporter
修改 prometheus 配置檔案[root@pre1 ~
]# mkdir -p /usr/local/prometheus/target/
[root@pre1 ~
]# cd /usr/local/prometheus/target/
[root@pre1 target]# ls
docker node
[root@pre1 target]# vim node/host_status.json[}
]
重啟 prometheus[root@pre1 target]# vim /usr/local/prometheus/conf/prometheus.yml
- job_name:
'host-status'
file_sd_configs:
- files:
-"/usr/local/prometheus/target/node/host_status.json"
refresh_interval:
6s
第一次引用,所以定義完成之後,需要重啟一下,如果後續再新增節點,則直接寫入json檔案即可,無需重啟prometheus服務
[root@pre1 target]# systemctl restart prometheus.service
檢視 prometheus 監控
檢視 grafana 的資料
Prometheus服務發現Consul
consul的集群介紹可以檢視這篇部落格 啟動第乙個consul服務 consul1 docker run name consul1 d p 8500 8500 p 8300 8300 p 8301 8301 p 8302 8302 p 8600 8600 consul 1.2.2 agent se...
Prometheus的服務發現
scrape configs the job name is added as a label job to any timeseries scraped from this config.job name nodes file sd configs files targets node yaml ...
Prometheus服務發現Consul
consul的集群介紹可以檢視這篇部落格 啟動第乙個consul服務 consul1 docker run name consul1 d p 8500 8500 p 8300 8300 p 8301 8301 p 8302 8302 p 8600 8600 consul 1.2.2 agent se...