安装在server03 - 192.168.174.137

wget https://github.com/prometheus/prometheus/releases/download/v2.5.0/prometheus 2.5.0.linux amd64.tar.gztar xf prometheus 2.5.0.linux amd64.tar.gzcp prometheus 2.5.0.linux amd64/{ prometheus,promtool } usr /local/查看版本
prometheus versioncd prometheus 2.5.0.linux amd64cp prometheus.yml prometheus.yml.origmkdir p /etc/prometheuscp prometheus.yml /etc/prometheuspromtool check config /etc/prometheus/prometheus.yml启动
prometheus --config.file /etc/prometheus/prometheus.yml

开始体验

node_exporter

下载

tar xf node_exporter-0.18.1.linux-amd64.tar.gz
cd node_exporter-0.18.1.linux-amd64/
cp node_exporter /usr/local/bin/

查看版本

root@server03:~/media/prometheus/node_exporter-0.18.1.linux-amd64# node_exporter --version
node_exporter, version 0.18.1 (branch: HEAD, revision: 3db77732e925c08f675d7404a8c46466b2ece83e)build user:       root@b50852a1acbabuild date:       20190604-16:41:18go version:       go1.12.5

配置 文本文件收集器
注:文本文件收集器,默认是加载的,我们只需要指定目录collector.textfile.directory

启用 system 收集器
采用collector.systemd.unit whitelist =“.+“ ,使用正则表达式

运行节点导出器
默认监听端口9100
nohup node_exporter --collector.textfile.directory /var/lib/node_exporter/textfile_collector --collector.systemd --collector.systemd.unit-whitelist="(docker|sshd|rsyslog).service" > node_exporter.out 2>&1 &

root@server03:~# netstat -antpl | grep 9100
tcp6       0      0 :::9100                 :::*                    LISTEN      74704/node_exporter

mkdir -p /var/lib/node_exporter/textfile_collectorecho 'metadata{role="docker_server",datacenter ="NJ"} 1' | tee /var/lib/node_exporter/textfile_collector/metadata.prom启动
nohup node_exporter --collector.textfile.directory /var/lib/node_exporter/textfile_collector --collector.systemd --collector.systemd.unit-whitelist="(docker|sshd|rsyslog).service" > node_exporter.out 2>&1 &

在 prometheus 服务器配置 scrap
vim /etc/prometheus/prometheus.yml

在服务器上过滤收集器
https://raw.githubusercontent.com/aishangwei/prometheus-demo/master/prometheus/prometheus.yml
注:使用 params 参数配合 collect ,过滤想要的数据

/etc/prometheus/prometheus.yml

- job_name: 'node'static_configs:- targets: ['192.168.174.137:9100']params:collect[]:- cpu- meminfo- diskstats

查看meminfo
node_memory_MemFree_bytes
硬盘信息
node_disk_writes_merged_total
cpu info
node_cpu_seconds_total

Prometheus相关推荐

  1. Prometheus+Granfana

    二.虚机(服务器)方式 prometheus在虚机(服务器)中安装运行. 命令行启动 在安装完成以后,可以直接在命令行启动.启动方式通常是: ./prometheus --config.file=pr ...

  2. 083、Prometheus架构(2019-05-05 周日)

    参考https://www.cnblogs.com/CloudMan6/p/7692765.html Prometheus 是一个非常优秀的监控工具,准确的说,应该是监控方案.Prometheus 提 ...

  3. Prometheus 对比 Zabbix

    公司要上监控,Prometheus 是最热门的监控解决方案,作为喜新厌旧的程序员,我当然是选择跟风了,但上级更倾向于 Zabbix,那没办法,只能好好对比一番,给出几个靠谱的理由了. 但稍稍深入一点, ...

  4. 在微服务架构下基于 Prometheus 构建一体化监控平台的最佳实践

    欢迎关注方志朋的博客,回复"666"获面试宝典 随着 Prometheus 逐渐成为云原生时代的可观测事实标准,那么今天为大家带来在微服务架构下基于 Prometheus 构建一体 ...

  5. Prometheus 有瓶颈?怎么打造企业级监控系统?

    欢迎关注方志朋的博客,回复"666"获面试宝典 来源 | https://cloud.tencent.com/developer/article/1690227 Thanos[1] ...

  6. 实战 Prometheus 搭建监控系统

    欢迎关注方志朋的博客,回复"666"获面试宝典 Prometheus 是一款基于时序数据库的开源监控告警系统,说起 Prometheus 则不得不提 SoundCloud,这是一个 ...

  7. Prometheus 如何做到“活学活用”,大牛总结的避坑指南

    点击上方蓝色"方志朋",选择"设为星标" 回复"666"获取独家整理的学习资料! 作者丨徐亚松 来源丨http://www.xuyasong ...

  8. 自从上线了 Prometheus 监控告警,真香!

    点击上方蓝色"方志朋",选择"设为星标" 回复"666"获取独家整理的学习资料! 对很多人来说,未知.不确定.不在掌控的东西,会有潜意识的逃 ...

  9. 监控神器Prometheus用不对,也就是把新手村的剑

    点击上方"方志朋",选择"设为星标" 回复"666"获取新整理的面试文章 作者丨徐亚松 来源丨http://www.xuyasong.com ...

  10. 全网最火的Nacos监控中心——Prometheus+Grafana

    最近公司在做Nacos监控这块,于是我就随手搭建了一台监控中心,虽然是国外的,但是对于功能上足够用了,下面我来介绍下怎么搭建!!! 1.准备环境 Nacos集群 参考地址:https://nacos. ...

最新文章

  1. MIT自然语言处理第一讲:简介和概述(第三部分)
  2. 渣男一般的产品经理长什么样?管过几百产品之后,谈谈如何做好这一行
  3. 文字检测与识别资料整理
  4. 【转】VC6.0附带小工具软件一览
  5. Java判断上传的文件是否是图片,如果是就对上传的图片进行压缩
  6. windows查看java进程详细信息的几种方法
  7. 20145240 《Java程序设计》第四次实验报告
  8. oracle使用loop将增加十天,使用loop循环操作DML语句
  9. 程序安装mysql数据库_安装Mysql数据库
  10. [原创]windows server 2012 AD架构试验系列 – 12 配置操作主机
  11. ROS :为IDE配置环境变量
  12. 03-23 卡顿分析
  13. 爬虫开发.1爬虫介绍
  14. 机器人社社长事迹_国际机器人大赛冠军背后的故事
  15. Vaughn Vernon谈云原生和反应式现状
  16. SqlServer数据库导入 mdf,ldf,ndf 格式文件操作
  17. JavaScript生成PDF
  18. link_path_walk()分析
  19. 问题:在vue中照片墙的照片数量超过限制数量后,要隐藏图片上传按钮,如何解决?
  20. ov7725图像帧率计算公式总结

热门文章

  1. 视频营销—网络营销的一种有效形式
  2. SE16N与SE16区别
  3. centos8安装nfs服务器
  4. PS部分实现helloworld
  5. 微信小程序之快递查询(完整版)
  6. 12306铁道部订票网站瘫痪 技术惹的祸?
  7. VTM10.0代码学习7:decompressCtu()xReconIntraQT()
  8. 电子取证技术的三大方向
  9. NumPy入门讲座(5):实战演练
  10. 这本书为什么会被誉为Spring开发百科全书(文末附带源码视频)