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

相关文章

JAVA中安装多个JDK的方法

《JAVA中安装多个JDK的方法》文章介绍了在Windows系统上安装多个JDK版本的方法,包括下载、安装路径修改、环境变量配置(JAVA_HOME和Path),并说明如何通过调整JAVA_HOME在... 首先去oracle官网下载好两个版本不同的jdk(需要登录Oracle账号,没有可以免费注册)下载完

Java JDK1.8 安装和环境配置教程详解

《JavaJDK1.8安装和环境配置教程详解》文章简要介绍了JDK1.8的安装流程,包括官网下载对应系统版本、安装时选择非系统盘路径、配置JAVA_HOME、CLASSPATH和Path环境变量,... 目录1.下载JDK2.安装JDK3.配置环境变量4.检验JDK官网下载地址:Java Downloads

SQL server数据库如何下载和安装

《SQLserver数据库如何下载和安装》本文指导如何下载安装SQLServer2022评估版及SSMS工具,涵盖安装配置、连接字符串设置、C#连接数据库方法和安全注意事项,如混合验证、参数化查... 目录第一步:打开官网下载对应文件第二步:程序安装配置第三部:安装工具SQL Server Manageme

prometheus如何使用pushgateway监控网路丢包

《prometheus如何使用pushgateway监控网路丢包》:本文主要介绍prometheus如何使用pushgateway监控网路丢包问题,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录监控网路丢包脚本数据图表总结监控网路丢包脚本[root@gtcq-gt-monitor-prome

Python中win32包的安装及常见用途介绍

《Python中win32包的安装及常见用途介绍》在Windows环境下,PythonWin32模块通常随Python安装包一起安装,:本文主要介绍Python中win32包的安装及常见用途的相关... 目录前言主要组件安装方法常见用途1. 操作Windows注册表2. 操作Windows服务3. 窗口操作

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根