tar -zxvf prometheus-2.8.1.linux-amd64.tar.gz -C /usr/local/
cd /usr/local
mv prometheus-2.8.1.linux-amd64/ prometheus
(4) 修改prometheus.yml文件
alerting:alertmanagers:-static_configs:-targets:# - alertmanager:9093# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.rule_files:# - "first_rules.yml"# - "second_rules.yml"# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.-job_name:"prometheus"# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:-targets:['localhost:9090']-job_name:"node1"static_configs:-targets:["172.16.20.210:9100"]labels:name:"霍山服务器1"ip:"172.16.20.210"-job_name:"node2"static_configs:-targets:["172.16.20.244:9100"]labels:name:"霍山服务器2"ip:"172.16.20.244"-job_name:"db1"static_configs:-targets:["172.16.20.210:9104"]labels:type:"mysql"servername:"hsdb1"name:"霍山db1"port:3306host:"172.16.20.210:9100"-job_name:"db1"static_configs:-targets:["172.16.20.244:9104"]labels:type:"mysql"servername:"hsdb2"name:"霍山db2"port:3306host:"172.16.20.244:9100"