prometheus-2.42.0.linux-amd64.tar.gz 安装配置展示

一、prometheus

1.1解压文件

# tar -xzvf prometheus-2.42.0.linux-amd64.tar.gz -C ~/apps/
prometheus-2.42.0.linux-amd64/
prometheus-2.42.0.linux-amd64/NOTICE
prometheus-2.42.0.linux-amd64/consoles/
prometheus-2.42.0.linux-amd64/consoles/index.html.example
prometheus-2.42.0.linux-amd64/consoles/node.html
prometheus-2.42.0.linux-amd64/consoles/prometheus-overview.html
prometheus-2.42.0.linux-amd64/consoles/node-disk.html
prometheus-2.42.0.linux-amd64/consoles/prometheus.html
prometheus-2.42.0.linux-amd64/consoles/node-overview.html
prometheus-2.42.0.linux-amd64/consoles/node-cpu.html
prometheus-2.42.0.linux-amd64/console_libraries/
prometheus-2.42.0.linux-amd64/console_libraries/menu.lib
prometheus-2.42.0.linux-amd64/console_libraries/prom.lib
prometheus-2.42.0.linux-amd64/prometheus.yml
prometheus-2.42.0.linux-amd64/LICENSE
prometheus-2.42.0.linux-amd64/promtool
prometheus-2.42.0.linux-amd64/prometheus

1.2修改名称

# mv prometheus-2.42.0.linux-amd64/ prometheus

1.3编写启停脚本


# 启动脚本
# cat start.sh 
nohup ./prometheus --config.file=prometheus.yml >> /data/apps/prometheus/prometheus.out 2>&1 &# 停止脚本
echo ' pkill prometheus' > stop.sh && chmod +x stop.sh

1.4启动

 tail -300f prometheus.out 
ts=2025-09-15T08:23:37.761Z caller=main.go:512 level=info msg="No time or size retention was set so using the default time retention" duration=15d
ts=2025-09-15T08:23:37.761Z caller=main.go:556 level=info msg="Starting Prometheus Server" mode=server version="(version=2.42.0, branch=HEAD, revision=225c61122d88b01d1f0eaaee0e05b6f3e0567ac0)"
ts=2025-09-15T08:23:37.761Z caller=main.go:561 level=info build_context="(go=go1.19.5, platform=linux/amd64, user=root@c67d48967507, date=20230201-07:53:32)"
ts=2025-09-15T08:23:37.761Z caller=main.go:562 level=info host_details="(Linux 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 host-10-15-32-71 (none))"
ts=2025-09-15T08:23:37.761Z caller=main.go:563 level=info fd_limits="(soft=655360, hard=655360)"
ts=2025-09-15T08:23:37.761Z caller=main.go:564 level=info vm_limits="(soft=unlimited, hard=unlimited)"
ts=2025-09-15T08:23:37.764Z caller=web.go:561 level=info component=web msg="Start listening for connections" address=0.0.0.0:9090
ts=2025-09-15T08:23:37.764Z caller=main.go:993 level=info msg="Starting TSDB ..."
ts=2025-09-15T08:23:37.766Z caller=tls_config.go:232 level=info component=web msg="Listening on" address=[::]:9090
ts=2025-09-15T08:23:37.766Z caller=tls_config.go:235 level=info component=web msg="TLS is disabled." http2=false address=[::]:9090
ts=2025-09-15T08:23:37.769Z caller=head.go:564 level=info component=tsdb msg="Replaying on-disk memory mappable chunks if any"
ts=2025-09-15T08:23:37.769Z caller=head.go:608 level=info component=tsdb msg="On-disk memory mappable chunks replay completed" duration=7.861µs
ts=2025-09-15T08:23:37.769Z caller=head.go:614 level=info component=tsdb msg="Replaying WAL, this may take a while"
ts=2025-09-15T08:23:37.772Z caller=head.go:685 level=info component=tsdb msg="WAL segment loaded" segment=0 maxSegment=0
ts=2025-09-15T08:23:37.772Z caller=head.go:722 level=info component=tsdb msg="WAL replay completed" checkpoint_replay_duration=28.034µs wal_replay_duration=3.003054ms wbl_replay_duration=453ns total_replay_duration=3.067185ms
ts=2025-09-15T08:23:37.776Z caller=main.go:1014 level=info fs_type=XFS_SUPER_MAGIC
ts=2025-09-15T08:23:37.776Z caller=main.go:1017 level=info msg="TSDB started"
ts=2025-09-15T08:23:37.776Z caller=main.go:1197 level=info msg="Loading configuration file" filename=prometheus.yml
ts=2025-09-15T08:23:37.777Z caller=main.go:1234 level=info msg="Completed loading of configuration file" filename=prometheus.yml totalDuration=1.36262ms db_storage=6.379µs remote_storage=5.581µs web_handler=803ns query_engine=4.284µs scrape=607.294µs scrape_sd=61.524µs notify=84.945µs notify_sd=22.443µs rules=5.972µs tracing=31.812µs
ts=2025-09-15T08:23:37.777Z caller=main.go:978 level=info msg="Server is ready to receive web requests."
ts=2025-09-15T08:23:37.777Z caller=manager.go:974 level=info component="rule manager" msg="Starting rule manager..."

1.5查看页面

二、grafana

2.1下载地址

https://mirrors.huaweicloud.com/grafana

2.2编写start.sh

# cat start.sh 
#!/bin/bash
nohup ./bin/grafana-server --config=./conf/custom.ini > logs/grafana.log 2>&1 &

2.3启动

logger=migrator t=2025-09-15T17:14:49.999438776+08:00 level=info msg="Executing migration" id="builtin role migration"
logger="builtin-role migrator" t=2025-09-15T17:14:50.004479811+08:00 level=info msg="no permission to create"
logger=migrator t=2025-09-15T17:14:50.020443663+08:00 level=info msg="Executing migration" id="seed permissions migration"
logger=migrator t=2025-09-15T17:14:50.045292656+08:00 level=info msg="Executing migration" id="managed permissions migration enterprise"
logger=migrator t=2025-09-15T17:14:50.064177991+08:00 level=info msg="migrations completed" performed=555 skipped=0 duration=52.21416628s
logger=sqlstore t=2025-09-15T17:14:50.63994826+08:00 level=info msg="Created default admin" user=admin
logger=sqlstore t=2025-09-15T17:14:50.641549473+08:00 level=info msg="Created default organization"
logger=licensing t=2025-09-15T17:14:50.662044382+08:00 level=info msg="Validated license token" appURL=http:/127.0.0.1:3000/ source=disk status=NotFound
logger=plugin.loader t=2025-09-15T17:14:50.757897484+08:00 level=info msg="Plugin registered" pluginID=input
logger=secrets t=2025-09-15T17:14:50.758477026+08:00 level=info msg="Envelope encryption state" enabled=true currentprovider=secretKey.v1
logger=query_data t=2025-09-15T17:14:50.76300753+08:00 level=info msg="Query Service initialization"
logger=live.push_http t=2025-09-15T17:14:50.858144587+08:00 level=info msg="Live Push Gateway initialization"
logger=infra.usagestats.collector t=2025-09-15T17:14:51.348265962+08:00 level=info msg="registering usage stat providers" usageStatsProvidersLen=2
vision alerting"
ng.alerting t=2025-09-15T17:14:51.349695788+08:00 level=info msg="starting to provision alerting"
logger=provisioning.alerting t=2025-09-15T17:14:51.349770585+08:00 level=info msg="finished to provision alerting"
logger=grafanaStorageLogger t=2025-09-15T17:14:51.350150116+08:00 level=info msg="storage starting"
-15T17:14:51.350438772+08:00 level=info msg="Warming state cache for startup"
logger=report t=2025-09-15T17:14:51.350539253+08:00 level=warn msg="Scheduling and sending of reports disabled, SMTP is not configured and enabled. Configure SMTP to enable."
logger=ngalert.state.manager t=2025-09-15T17:14:51.350438772+08:00 level=info msg="Warming state cache for startup"
logger=ngalert.state.manager t=2025-09-15T17:14:51.354009767+08:00 level=info msg="State cache has been initialized" states=0 duration=3.567255ms
logger=ticker t=2025-09-15T17:14:51.354176273+08:00 level=info msg=starting first_tick=2025-09-15T17:15:00+08:00
logger=ngalert.multiorg.alertmanager t=2025-09-15T17:14:51.354267264+08:00 level=info msg="starting MultiOrg Alertmanager"
logger=http.server t=2025-09-15T17:14:51.356067513+08:00 level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket=

2.4页面登录

三、node_exporter

3.1解压

# tar -xzvf node_exporter-1.5.0.linux-amd64.tar.gz 
node_exporter-1.5.0.linux-amd64/
node_exporter-1.5.0.linux-amd64/LICENSE
node_exporter-1.5.0.linux-amd64/NOTICE
node_exporter-1.5.0.linux-amd64/node_exporter

3.2启动

# cat start.sh
./node_exporter &
# ./start.sh 
[isee@host-10-15-32-71 node_exporter]$ ts=2025-09-15T09:32:43.494Z caller=node_exporter.go:180 level=info msg="Starting node_exporter" version="(version=1.5.0, branch=HEAD, revision=1b48970ffcf5630534fb00bb0687d73c66d1c959)"
ts=2025-09-15T09:32:43.494Z caller=node_exporter.go:181 level=info msg="Build context" build_context="(go=go1.19.3, user=root@6e7732a7b81b, date=20221129-18:59:09)"
ts=2025-09-15T09:32:43.495Z caller=filesystem_common.go:111 level=info collector=filesystem msg="Parsed flag --collector.filesystem.mount-points-exclude" flag=^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+|var/lib/containers/storage/.+)($|/)
ts=2025-09-15T09:32:43.495Z caller=filesystem_common.go:113 level=info collector=filesystem msg="Parsed flag --collector.filesystem.fs-types-exclude" flag=^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$
ts=2025-09-15T09:32:43.496Z caller=diskstats_common.go:111 level=info collector=diskstats msg="Parsed flag --collector.diskstats.device-exclude" flag=^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:110 level=info msg="Enabled collectors"
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=arp
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=bcache
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=bonding
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=btrfs
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=conntrack
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=cpu
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=cpufreq
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=diskstats
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=dmi
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=edac
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=entropy
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=fibrechannel
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=filefd
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=filesystem
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=hwmon
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=infiniband
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=ipvs
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=loadavg
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=mdadm
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=meminfo
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=netclass
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=netdev
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=netstat
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=nfs
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=nfsd
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=nvme
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=os
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=powersupplyclass
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=pressure
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=rapl
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=schedstat
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=selinux
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=sockstat
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=softnet
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=stat
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=tapestats
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=textfile
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=thermal_zone
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=time
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=timex
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=udp_queues
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=uname
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=vmstat
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=xfs
ts=2025-09-15T09:32:43.498Z caller=node_exporter.go:117 level=info collector=zfs
ts=2025-09-15T09:32:43.499Z caller=tls_config.go:232 level=info msg="Listening on" address=[::]:9100
ts=2025-09-15T09:32:43.499Z caller=tls_config.go:235 level=info msg="TLS is disabled." http2=false address=[::]:9100

3.3查看进程

# netstat -antp |grep 9100
(Not all processes could be identified, non-owned process infowill not be shown, you would have to be root to see it all.)
tcp6       0      0 :::9100                 :::*                    LISTEN      30904/./node_export 

3.4页面查看

四、配置prometheus

4.1修改prometheus.yml

文件最后添加被监控的主机ip:port,将ip换成自己的ip。

static_configs:  - targets: #["192.168.202.128:9090",'192.168.202.128:9100','192.168.202.129:9100']  - "192.168.202.128:9090"- '192.168.202.128:9100'- '192.168.202.129:9100'

4.2重启prometheus

 pkill prometheus

4.3查看页面

新监控的主机,已经能获取到了。

五、配置grafana

5.1登录grafana页面,并进入主页面

5.2访问下面地址,去选择模板

https://grafana.com/grafana/dashboards/https://grafana.com/grafana/dashboards/

5.3选择一个模板后

5.4记录第二步,第三步,然后到自己的grafana页面

5.5完成效果

https://blog.csdn.net/m0_74766687/article/details/143424636

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/bicheng/98108.shtml
繁体地址,请注明出处:http://hk.pswp.cn/bicheng/98108.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux 标准输入 标准输出 标准错误

目录一. 简介二. 常见用法2.1 输出重定向2.2 错误重定向2.3 同时重定向标准输出 错误2.4 输入重定向2.5 特殊设备三. 这样设计的好处3.1 区分正常信息和错误信息3.2 方便调用方脚本处理3.3 与管道结合时更清晰四. 案例4.1 if判断4.2 ls查询一. 简介 ⏹在 Linux/Unix 中&#…

零基础新手小白快速了解掌握服务集群与自动化运维(二)Linux Journalctl命令、Journalctl日志持久化存储

Linux提供了一个强大的日志系统,它可以跟踪和记录系统的各种活动。在这个系统中,journalctl是一个非常重要的工具,用于查询和操作由systemd进程管理的日志。 本文将深入探讨journalctl命令,介绍其基本使用、高级选项及示例等内容…

【学习】【js】栈数据结构

栈 栈是一种遵从后进先出(LIFO)原则的有序集合。新添加或待删除的元素都保存在栈的同一端,称作栈顶,另一端就叫栈底。在栈里,新元素都靠近栈顶,旧元素都接近栈底。 基于数组的栈 时间复杂度O(n),占用较多的…

【Linux】基本指令 · 下

alias 指令起别名为什么 ls -l 指令等价于 ll 指令呢?指令就是可执行程序,和我们自己写的代码编译好的程序,没有本质区别! 指令在系统的某一个位置存在! 执行指令前,现在系统中查找对应的指令指令在根目录下…

计算机视觉(opencv)实战二十二——指纹图像中提取特征点,计算两两指纹之间的相似度

指纹识别原理与代码实现详解指纹识别是一种常见的生物特征识别技术,广泛应用于门禁系统、手机解锁、考勤打卡、身份认证等场景。其核心思想是:从指纹图像中提取特征点,计算两幅指纹之间的相似度,并根据相似度判断是否为同一人。本…

Linux基础之部署mysql数据库

文章目录一、环境准备二、源码解压与依赖三、CMake 编译配置四、配置 MySQL权限管理修改配置文件 /etc/my.cnf五、环境变量设置六、数据库初始化七、服务管理八、账号密码管理一、环境准备 yum -y install gcc gcc-c ncurses ncurses-devel bison cmakegcc / gcc-c&#xff1a…

代码审计-PHP专题原生开发文件上传删除包含文件操作监控Zend源码解密1day分析

快速分析脆弱:1、看文件路径2、看代码里面的变量(可控)3、看变量前后的过滤文件安全挖掘点:1、脚本文件名2、应用功能点3、操作关键字文件上传,文件下载(读取),文件包含,文件删除等emlog-文件上…

零基础搭建 Hexo 博客:从本地到 GitHub Pages 全流程指南

零基础搭建 Hexo 博客:从本地到 GitHub Pages 全流程指南 Hexo 是一个快速、简洁且高效的博客框架,支持使用 Markdown 来编写文章,并能快速生成静态网页,非常适合想要搭建个人博客的同学。本文将带你从零开始,本地搭建…

Git 简介

Git 是目前全球最流行的分布式版本控制系统(Distributed Version Control System, DVCS),核心作用是追踪文件修改历史、支持多人协同开发,并能高效管理代码(或任何文本类文件)的版本迭代。它由 Linux 内核创…

后端Web实战-Spring原理

目录 1. 配置优先级 2. Bean管理 2.1 获取Bean 2.2 Bean作用域 面试题:Lazy是如何解决循环依赖问题的? 2.3 第三方Bean 3. SpringBoot原理 3.1 起步依赖 3.2 自动配置 3.2.1 概述 3.2.2 自动配置的原理及常见方案 3.2.2.1 概述 3.2.2.2 方案…

在 Qoder 等 AI 二创 IDE 里用 VS Code Remote-SSH 的“曲线连接”实战

目标:让你在 Qoder 等在线/AI 辅助 IDE 中,也能像本地 VS Code 一样通过 Remote-SSH 连接到自己的远程服务器进行开发。 前提:只在你拥有或被授权的服务器上使用,遵守所用平台的条款与限制。两句话说清楚 先用本地 VS Code 正常连…

python发送请求SSL验证设置

这个错误通常是由于SSL/TLS握手失败导致的,可能原因包括证书验证问题、不兼容的加密协议或网络连接中断。以下是几种解决方案,按推荐顺序排列: 方案一:临时禁用SSL验证(快速测试) response requests.get(u…

工厂自动化正从 “人工堆叠” 向 “设备替代” 快速转变

​人工进行零件排列,虽在操作灵活性上有一定表现,但实际应用中存在明显短板,对工厂自动化转型形成制约。从成本来看,一名工人日均工资约数百元,若需 5-6 名工人协同作业,月均人力成本易突破万元&#xff0c…

中标麒麟7.4部署gitlab-runner

1. 部署环境 本次部署环境完全断网。需要离线下载gitlab-runner及其依赖。 本次部署环境为中标麒麟7.4。目前机器上部署了gitlab,安装了maven。 2. 部署步骤 2.1 在外部下载好依赖 我首先在腾讯云上布置了一个centos7.9的虚拟机,没有安装任何东西。 …

在 IDEA 2024 创建 Vue 项目(保姆级)

目录 一、 前后端分离 1. 简介 2. 实现前后端分离的常用前端框架 3. 前后端分离和动静分离 3.1 前后端分离: 3.2 动静分离: 二、 Vue.js概述 1. 简介 2. SPA介绍 2.1 优点 2.2 缺点 3. MVVM介绍 3.1 示例 三、 名词解释 1. Node.js 2. npm 3. webpack 4. Vue…

Coze源码分析-资源库-创建知识库-后端源码-应用/领域/数据访问

3. 应用服务层 3.1 知识库应用服务 文件位置: backend/application/knowledge/knowledge.go func (k *KnowledgeApplicationService) CreateKnowledge(ctx context.Context, req *dataset.CreateDatasetRequest) (*dataset.CreateDatasetResponse, error) {// 1. 转换文档类型d…

Shopify指纹手机矩阵:无限扩店,横扫FB/GG广告封号风险

一、 为什么需要为Shopify使用指纹手机?虽然Shopify不会因为你多开店而封号,但以下场景需要隔离环境:规避广告平台关联:这是最核心的用途。你会用Facebook、Google、TikTok等广告平台为你的Shopify店铺引流。这些广告平台严格禁止…

【Python】家庭用电数据分析Prophet预测

数据集:Household Electricity Consumption | Kaggle 目录 数据集简介 探索性分析 Prophet预测 Prophet模型 Prophet理念 Prophet优点 数据集简介 240000-household-electricity-consumption-records数据集包含了一个家庭6个月的用电数据,收集于2…

信息系统运维管理

运行维护服务指的是采用信息技术手段及方法,依据客户提出的服务要求,为其在使用信息系统过程中提出的需求提供的综合服务是信息技术服务中的一种主要类型。运行维护服务对象是指信息系统工程建设项目交付的内容,包括机房基础设施,…

系统编程完结整理以及补充

Shell(命令与脚本语法) 系统编程(一)shell的学习-CSDN博客 功能/概念语法/关键字参数/用法说明返回值/效果难易点注意事项示例/实验提示定义函数func_name() { commands; }无参数或通过 $1 $2 ... 传参函数执行参数传递、全局变…