美文网首页
Prometheus部署与实战

Prometheus部署与实战

作者: 天夭夭 | 来源:发表于2019-06-05 16:50 被阅读0次

一、Prometheus部署
cd /opt
wget https://github.com/prometheus/prometheus/releases/download/v2.8.1/prometheus-2.8.1.linux-amd64.tar.gz
备注:其他版本请到官方下载https://prometheus.io/download/
tar zxf prometheus-2.8.1.linux-amd64.tar.gz
mv prometheus-2.8.1.linux-amd64 prometheus
mv /opt/prometheus/prometheus.yml /opt/prometheus/prometheus.yml.bak
vim /opt/prometheus/prometheus.yml
添加配置
global:
scrape_interval: 15s # 抓取时间,默认60s
evaluation_interval: 15s
external_labels:
monitor: 'codelab-monitor'
rule_files:
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
#服务注册与发现
- job_name: 'consul-prometheus'
consul_sd_configs:
#consul 地址
- server: 'consul:8500'
services: []

  启动服务:
  /opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml &
  验证:可在浏览器上访问:localhost:9090

相关文章

网友评论

      本文标题:Prometheus部署与实战

      本文链接:https://www.haomeiwen.com/subject/yojsxctx.html