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
英文地址,請注明出處:http://en.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 ... 傳參函數執行參數傳遞、全局變…