简介

第1节:Prometheus 简介 · Prometheus 中文文档

Configuration | Prometheus

prometheus(普罗米修斯):天生为采集存储监控数据而生的时序数据库。prometheus通过各种Exporter采集到监控数据,然后存储进prometheus中,以供查询展示

grafana:一个监控仪表系统。grafana的数据来源可以有很多(如:Prometheus、Graphite、OpenTSDB、InfluxDB、MySQL/PostgreSQL、Microsoft SQL Serve等等),其中用得最多的数据源是prometheus

注:prometheus也有自己的UI,不过功能没有grafana强大

原理

image.png

镜像安装

docker pull prom/node-exporter
docker pull prom/prometheus
docker pull grafana/grafana

启动prom/node-exporter

启动后访问:http://127.0.0.1:9100/metrics

docker run -d -p 9100:9100 \\
  -v "/proc:/host/proc:ro" \\
  -v "/sys:/host/sys:ro" \\
  -v "/:/rootfs:ro" \\
  prom/node-exporter

建立目录

mkdir -p /Users/个人用户名称/devlop/prometheusTest/prometheus
mkdir /Users/个人用户名称/devlop/prometheusTest/grafana-storage

启动**Prometheus**

编辑Prometheus配置文件prometheus.yml,路径修改为/Users/个人用户名称/devlop/prometheusTest/prometheus/prometheus.yml

cd /Users/个人用户名称/devlop/prometheusTest/prometheus
vim prometheus.yml

写入内容