Prometheus + Grafana 快速上手

Prometheus + Grafana 快速上手,监控主机的 CPU, GPU, MEM, IO 等状态。

前提

客户端

Node Exporter

用于采集 UNIX 内核主机的数据,这里下载并解压:

1wget https://github.com/prometheus/node_exporter/releases/download/v1.1.2/node_exporter-1.1.2.linux-amd64.tar.gz 2tar xvfz node_exporter-1.1.2.linux-amd64.tar.gz 3cd node_exporter-1.1.2.linux-amd64 4nohup ./node_exporter &

查看数据:

1$ curl http://localhost:9100/metrics 2# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles. 3# TYPE go_gc_duration_seconds summary 4go_gc_duration_seconds{quantile="0"} 0 5go_gc_duration_seconds{quantile="0.25"} 0 6go_gc_duration_seconds{quantile="0.5"} 0 7...

DCGM Exporter

用于采集 NVIDIA GPU 的数据,以 Docker 镜像运行:

1docker run -d --restart=always --gpus all -p 9400:9400 nvidia/dcgm-exporter

查看数据:

1$ curl localhost:9400/metrics 2# HELP DCGM_FI_DEV_SM_CLOCK SM clock frequency (in MHz). 3# TYPE DCGM_FI_DEV_SM_CLOCK gauge 4# HELP DCGM_FI_DEV_MEM_CLOCK Memory clock frequency (in MHz). 5# TYPE DCGM_FI_DEV_MEM_CLOCK gauge 6# HELP DCGM_FI_DEV_MEMORY_TEMP Memory temperature (in C). 7...

服务器

Prometheus

配置 ~/prometheus.yml:

1global: 2 scrape_interval: 15s 3 4scrape_configs: 5# Node Exporter 6- job_name: node 7 static_configs: 8 - targets: ['192.167.200.91:9100'] 9# DCGM Exporter 10- job_name: dcgm 11 static_configs: 12 - targets: ['192.167.200.91:9400']

运行 Docker 镜像:

1docker run -d --restart=always \ 2-p 9090:9090 \ 3-v ~/prometheus.yml:/etc/prometheus/prometheus.yml \ 4prom/prometheus

访问 http://localhost:9090/ :

访问 http://localhost:9090/targets :

Grafana

运行 Docker 镜像:

1docker run -d --restart=always -p 3000:3000 grafana/grafana

访问 http://localhost:3000/ :

以 admin/admin 登录。

新增数据源

新增 Prometheus:

点击 Save & Test:

导入仪表盘

导入 8919 Node Exporter for Prometheus Dashboard by StarsL.cn:

查看仪表盘:

导入 12239 NVIDIA DCGM Exporter Dashboard by nvidia:

查看仪表盘:

参考

GoCoding 个人实践的经验分享,可关注公众号!

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )