grafana+prometheus linux环境搭建及使用

本文详细介绍了如何在Linux系统上搭建Grafana和Prometheus监控系统。首先通过拉取镜像、创建配置文件和权限设置来搭建Prometheus,然后通过配置数据源和选择模板实现Grafana的可视化配置。最后验证了监控系统的正常运行,并提供了相关模板的获取和使用方法。
摘要由CSDN通过智能技术生成

一、搭建

step 1 拉取镜像

docker pull prom/node-exporter  #用来监控系统CPU、内存、硬盘等
docker pull prom/prometheus     
docker pull grafana/grafana
docker pull google/cadvisor     #用来监控容器

step2 创建prometheus配置文件路径,编辑配置文件

mkdir prometheus
cd prometheus
vim prometheus.yml

prometheus.xml文件

global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'codelab-monitor'

# 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'

    # Override the global defaul
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值