prometheus 安装 node_exporter

2024-05-26 03:32

本文主要是介绍prometheus 安装 node_exporter,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

prometheus 安装

  • 1,Ubuntu 16.04安装prometheus
  • 2,测试启动
    • 2.1,运行前检查配置文件
    • 2.2,修改`prometheus.yml`获取监控数据
    • 2.3,prometheus开机启动
  • 3,node_exporter安装
    • 3.1,node_exporter开机启动
    • 3.1,监控多个主机
  • 4,prometheus查看targets
  • 5,数据可视化显示
    • 5.1,Grafana导入面板

1,Ubuntu 16.04安装prometheus

  • prometheus-2.18.1.darwin-amd64.tar.gz
# tar -zxvf prometheus-2.18.1.linux-amd64.tar.gz
  • 设置环境变量
  • vim /root/.bashrc
#prometheus
export PATH=$PATH:/root/prometheus-2.18.1.linux-amd64

2,测试启动

prometheus --config.file=/root/prometheus-2.18.1.linux-amd64/prometheus.yml
  • 0.0.0.0:9090

在这里插入图片描述

2.1,运行前检查配置文件

# ./promtool check config prometheus.yml
Checking prometheus.ymlSUCCESS: 0 rule files found

2.2,修改prometheus.yml获取监控数据

  • vim prometheus.yml增加job_name
scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name: 'prometheus'# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:- targets: ['localhost:9090']# node_exporter- job_name: 'node'static_configs:- targets: ['127.0.0.1:9100']

2.3,prometheus开机启动

# vim /lib/systemd/system/prometheus.service
# cat /lib/systemd/system/prometheus.service
[Unit]
Description=prometheus service[Service]
User=root
ExecStart=/root/prometheus-2.18.1.linux-amd64/prometheus --config.file=/root/prometheus-2.18.1.linux-amd64/prometheus.ymlTimeoutStopSec=10
Restart=on-failure
RestartSec=5[Install]
WantedBy=multi-user.target
# systemctl daemon-reload
# systemctl enable prometheus.service
Created symlink /etc/systemd/system/multi-user.target.wants/prometheus.service → /lib/systemd/system/prometheus.service.
# systemctl start prometheus.service
# systemctl status prometheus.service

3,node_exporter安装

  • node_exporter-1.0.0.linux-amd64.tar.gz
# tar -zxvf node_exporter-1.0.0.linux-amd64.tar.gz
# cd node_exporter-1.0.0.linux-amd64/
# ./node_exporter
  • 访问ip:9100
    在这里插入图片描述
  • 增加配置prometheus
  • vim prometheus.yml
  - job_name: 'node'static_configs:#- targets: ['localhost:9090']- targets: ['127.0.0.1:9100']

3.1,node_exporter开机启动

# cat /lib/systemd/system/node_exporter.service
[Unit]
Description=node_exporter service[Service]
User=root
ExecStart=/root/node_exporter-1.0.0.linux-amd64/node_exporterTimeoutStopSec=10
Restart=on-failure
RestartSec=5[Install]
WantedBy=multi-user.target
# systemctl daemon-reload
# systemctl enable node_exporter.service
# systemctl start node_exporter.service
# systemctl status node_exporter.service

3.1,监控多个主机

  • 192.168.0.3 只运行node_exporter
  • 192.168.0.2 运行有prometheus
  • 配置prometheus.yml
  • targets配置多个IP地址
# cat prometheus.ymlstatic_configs:- targets: ['localhost:9090']# node_exporter- job_name: 'node'static_configs:- targets: ['127.0.0.1:9100','192.168.0.3:9100']

4,prometheus查看targets

在这里插入图片描述

5,数据可视化显示

5.1,Grafana导入面板

在这里插入图片描述

  • id为8919
  • 数据源选择prometheus
    在这里插入图片描述

在这里插入图片描述


参考:

  1. prometheus download
  2. prometheus started
  3. Prometheus ubuntu安装使用
  4. prometheus+grafana 安装配置
  5. node_exporter
  6. Prometheus 实战
  7. Prometheus监控系统 安装与配置详细教程
  8. prometheus-book 使用Node Exporter采集主机数据
  9. Prometheus 配置
  10. Prometheus部署各服务的Node监控
  11. 使用 Grafana + Prometheus + Node-Exporter 监控机器
  12. 1 Node Exporter for Prometheus Dashboard CN v20200530

这篇关于prometheus 安装 node_exporter的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1003410

相关文章

Node.js net模块的使用示例

《Node.jsnet模块的使用示例》本文主要介绍了Node.jsnet模块的使用示例,net模块支持TCP通信,处理TCP连接和数据传输,具有一定的参考价值,感兴趣的可以了解一下... 目录简介引入 net 模块核心概念TCP (传输控制协议)Socket服务器TCP 服务器创建基本服务器服务器配置选项服

mac安装nvm(node.js)多版本管理实践步骤

《mac安装nvm(node.js)多版本管理实践步骤》:本文主要介绍mac安装nvm(node.js)多版本管理的相关资料,NVM是一个用于管理多个Node.js版本的命令行工具,它允许开发者在... 目录NVM功能简介MAC安装实践一、下载nvm二、安装nvm三、安装node.js总结NVM功能简介N

python安装whl包并解决依赖关系的实现

《python安装whl包并解决依赖关系的实现》本文主要介绍了python安装whl包并解决依赖关系的实现,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面... 目录一、什么是whl文件?二、我们为什么需要使用whl文件来安装python库?三、我们应该去哪儿下

MySQL安装时initializing database失败的问题解决

《MySQL安装时initializingdatabase失败的问题解决》本文主要介绍了MySQL安装时initializingdatabase失败的问题解决,文中通过图文介绍的非常详细,对大家的学... 目录问题页面:解决方法:问题页面:解决方法:1.勾选红框中的选项:2.将下图红框中全部改为英

MySQL9.0默认路径安装下重置root密码

《MySQL9.0默认路径安装下重置root密码》本文主要介绍了MySQL9.0默认路径安装下重置root密码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们... 目录问题描述环境描述解决方法正常模式下修改密码报错原因问题描述mysqlChina编程采用默认安装路径,

Python使用国内镜像加速pip安装的方法讲解

《Python使用国内镜像加速pip安装的方法讲解》在Python开发中,pip是一个非常重要的工具,用于安装和管理Python的第三方库,然而,在国内使用pip安装依赖时,往往会因为网络问题而导致速... 目录一、pip 工具简介1. 什么是 pip?2. 什么是 -i 参数?二、国内镜像源的选择三、如何

Python安装时常见报错以及解决方案

《Python安装时常见报错以及解决方案》:本文主要介绍在安装Python、配置环境变量、使用pip以及运行Python脚本时常见的错误及其解决方案,文中介绍的非常详细,需要的朋友可以参考下... 目录一、安装 python 时常见报错及解决方案(一)安装包下载失败(二)权限不足二、配置环境变量时常见报错及

MySQL8.2.0安装教程分享

《MySQL8.2.0安装教程分享》这篇文章详细介绍了如何在Windows系统上安装MySQL数据库软件,包括下载、安装、配置和设置环境变量的步骤... 目录mysql的安装图文1.python访问网址2javascript.点击3.进入Downloads向下滑动4.选择Community Server5.

CentOS系统Maven安装教程分享

《CentOS系统Maven安装教程分享》本文介绍了如何在CentOS系统中安装Maven,并提供了一个简单的实际应用案例,安装Maven需要先安装Java和设置环境变量,Maven可以自动管理项目的... 目录准备工作下载并安装Maven常见问题及解决方法实际应用案例总结Maven是一个流行的项目管理工具

通过prometheus监控Tomcat运行状态的操作流程

《通过prometheus监控Tomcat运行状态的操作流程》文章介绍了如何安装和配置Tomcat,并使用Prometheus和TomcatExporter来监控Tomcat的运行状态,文章详细讲解了... 目录Tomcat安装配置以及prometheus监控Tomcat一. 安装并配置tomcat1、安装