基于华为云欧拉操作系统(HCE OS)单节点容器化部署(Prometheus、node-exporter、Grafana)应用性能监控平台

写在前面


  • 博文内容为 华为云欧拉操作系统入门级开发者认证(HCCDA – Huawei Cloud EulerOS)实验笔记整理
  • 认证地址:https://edu.huaweicloud.com/certificationindex/developer/9bf91efb086a448ab4331a2f53a4d3a1
  • 内容涉及,HCE OS 容器化部署(Prometheus、node-exporter、Grafana)应用性能监控平台
  • 理解不足小伙伴帮忙指正

不必太纠结于当下,也不必太忧虑未来,当你经历过一些事情的时候,眼前的风景已经和从前不一样了。——村上春树


创建一个专用网络,这个网络一般是业务对应网络

[root@ecs-hce ]# docker network create oa-net
8858411315a892cd61bbe8b31411595dd8b013792fd05ab68806f3ca5572c3a7

部署 Prometheus

下载 Prometheus 镜像, 查看 Prometheus 镜像

[root@ecs-hce ~]# cd ~ && docker pull prom/prometheus
Using default tag: latest
latest: Pulling from prom/prometheus
9fa9226be034: Pull complete
1617e25568b2: Pull complete
0af4f5a1aba4: Pull complete
524450aac7ac: Pull complete
3427b0266353: Pull complete
87f5816afa35: Pull complete
fe81a20504a7: Pull complete
bfac845c5ca1: Pull complete
6c1aa870016a: Pull complete
6126ba6f9b4f: Pull complete
68d61c64cf66: Pull complete
5e5897603b11: Pull complete
Digest: sha256:beb5e30ffba08d9ae8a7961b9a2145fc8af6296ff2a4f463df7cd722fcbfc789
Status: Downloaded newer image for prom/prometheus:latest
[root@ecs-hce ~]# docker images|grep prometheus
prom/prometheus      latest              2a72b385beaf        3 weeks ago         250MB

启动 Prometheus 容器, 这里需要注意端口和网络

[root@ecs-hce ~]# docker run -id --name=prom --network=oa-net -p  9090:9090 prom/prometheus
b1f8fb907b6963e84df3e9ca1cb7e190d9089e582ebff20956c33321fcbd219c

验证 Prometheus,在浏览器输入 EIP:9090 访问 Prometheus

在这里插入图片描述

在这里插入图片描述

点击 Endpoint 下的链接,此时会发现页面无法访问,需要修改配置文件

[root@ecs-hce ~]# mkdir prometheus
[root@ecs-hce ~]# docker cp prom:/etc/prometheus/prometheus.yml ./prometheus
[root@ecs-hce ~]# vim prometheus/prometheus.yml```yaml
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"]

修改 targets 对应的值为 eip:9090,并且保存退出

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: ["120.46.64.191:9090"]

停止 prom 容器,删除 prom 容器,重新启动 Prometheus 容器

[root@ecs-hce ~]# docker stop prom
prom
[root@ecs-hce ~]# docker rm prom
prom

需要注意 -v /root/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml,这里直接映射的文件

[root@ecs-hce ~]# docker run -id --name=prom --network=oa-net -p  9090:9090 -v /root/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml  prom/prometheus
08905b1011feb7e98431f53e53eadf8f5bb1ce6d44eb0894fb13b9598efa4c1f
[root@ecs-hce ~]#

通过 EIP:9090 访问 Prometheus,并进入 Status 选项下 Targets 页面

在这里插入图片描述

部署 node-exporter

下载 node-exporter 镜像

[root@ecs-hce ~]# docker pull prom/node-exporter
Using default tag: latest
latest: Pulling from prom/node-exporter
2abcce694348: Pull complete
455fd88e5221: Pull complete
324153f2810a: Pull complete
Digest: sha256:4cb2b9019f1757be8482419002cb7afe028fdba35d47958829e4cfeaf6246d80
Status: Downloaded newer image for prom/node-exporter:latest

启动 node-exporter,注意网络和端口配置

[root@ecs-hce ~]# docker run -id --name=node-exporter --network=oa-net -p 9100:9100 prom/node-exporter
933a43e1cebbdc2192928c69b0e0f60faf84156601caed0548f08cafe979923d

修改 Prometheus 配置文件,重新启动 prometheus

[root@ecs-hce ~]# vim prometheus/prometheus.yml
scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name: "node-exporter"static_configs:- targets: ["120.46.64.191:9100"]- job_name: "prometheus"# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:- targets: ["120.46.64.191:9090"]
[root@ecs-hce ~]# docker restart prom
prom
[root@ecs-hce ~]#

通过 EIP:9090 访问 Prometheus,在 Status—Targets 页面下,可以看到新配置的 node-exporter 数据源。

在这里插入图片描述

部署 Grafana

下载 Grafana 镜像

[root@ecs-hce ~]# docker pull grafana/grafana
Using default tag: latest
latest: Pulling from grafana/grafana
96526aa774ef: Pull complete
c7ba78600384: Pull complete
c27e091f8ead: Pull complete
1d06c4d0ba22: Pull complete
183afb97c8c4: Pull complete
409b84eddcee: Pull complete
10a0006e04fc: Downloading [==========>                                        ]  11.79MB/53.8MB
24decdaaac3e: Download complete
10a0006e04fc: Pull complete
24decdaaac3e: Pull complete
e178ee908fb8: Pull complete
d42dc690a758: Pull complete
Digest: sha256:7567a7c70a3c1d75aeeedc968d1304174a16651e55a60d1fb132a05e1e63a054
Status: Downloaded newer image for grafana/grafana:latest
[root@ecs-hce ~]#
[root@ecs-hce ~]#
[root@ecs-hce ~]# docker images grafana/grafana
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
grafana/grafana     latest              2fec87cd4362        2 weeks ago         406MB

启动 Grafana 容器,注意这里的端口和网络,grafana 并不需要和上面的组件放到同一个网络里面

[root@ecs-hce ~]# docker run -d --name grafana -p 3000:3000 grafana/grafana
ab78373b51595e6de467d2e42f119309f9a301ff31e7ed89525334f7e0ed5e47
[root@ecs-hce ~]#

通过 EIP:3000 访问 Grafana,初始账号为 admin,密码为 admin

在这里插入图片描述

登录后,DATA SOURCE,增加数据源

在这里插入图片描述

到这里容器化部署Prometheus、node-exporter、Grafana就完成了,之后可以根据情况配置面板

© 文中涉及参考链接内容版权归原作者所有,如有侵权请告知 😃


https://edu.huaweicloud.com/certificationindex/developer/9bf91efb086a448ab4331a2f53a4d3a1


© 2018-2024 liruilonger@gmail.com, All rights reserved. 保持署名-非商用-相同方式共享(CC BY-NC-SA 4.0)

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

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

分布式springboot 3项目集成mybatis官方生成器开发记录

文章目录 说明实现思路实现步骤第一步&#xff1a;创建generator子模块第二步&#xff1a;引入相关maven插件和依赖第三步&#xff1a;编写生成器配置文件第四步&#xff1a;运行查看结果 说明 该文章为作者开发学习记录&#xff0c;方便以后复习和交流主要内容为&#xff1a;…

【精选】java继承进阶——构造方法的访问特点 this、super使用

&#x1f36c; 博主介绍&#x1f468;‍&#x1f393; 博主介绍&#xff1a;大家好&#xff0c;我是 hacker-routing &#xff0c;很高兴认识大家~ ✨主攻领域&#xff1a;【渗透领域】【应急响应】 【python】 【VulnHub靶场复现】【面试分析】 &#x1f389;点赞➕评论➕收藏…

算法导论 总结索引 | 第一部分 第三章:函数的增长

研究算法的 渐近效率 1、渐近记号&#xff08;40&#xff09; 1、Θ&#xff1a; 使得 对于足够大的n&#xff0c;函数 f(n) 能 夹入 c1g(n) 与 c2g(n) 之间&#xff0c;则 f(n) ∈ 集合Θ(g(n)) g(n) 是 f(n) 的一个渐近紧确界 g(n)本身 必为渐近非负 使用 Θ(1) 来意指 …

【Spring源码解读!底层原理进阶】【下】探寻Spring内部:BeanFactory和ApplicationContext实现原理揭秘✨

&#x1f389;&#x1f389;欢迎光临&#x1f389;&#x1f389; &#x1f3c5;我是苏泽&#xff0c;一位对技术充满热情的探索者和分享者。&#x1f680;&#x1f680; &#x1f31f;特别推荐给大家我的最新专栏《Spring 狂野之旅&#xff1a;底层原理高级进阶》 &#x1f680…

[超分辨率重建]ESRGAN算法训练自己的数据集过程

一、下载数据集及项目包 1. 数据集 1.1 文件夹框架的介绍&#xff0c;如下图所示&#xff1a;主要有train和val&#xff0c;分别有高清&#xff08;HR&#xff09;和低清&#xff08;LR&#xff09;的图像。 1.2 原图先通过分割尺寸的脚本先将数据集图片处理成两个相同的图像…

c++之说_13|模板 折叠表达式

折叠表达式 可以通过形参包的的实际参数&#xff08;不是类型&#xff09; 展开式子 这是这里说的几种 实际上并还有一些写法 先介绍这几种吧 #include <cstdio> template<typename T,T... n> struct integer_sequence {T val; }; template<int idx,typenam…

GEE详细教程之:将Landsat8与Landsat9影像合成一个影像

1.前言 因项目需求&#xff0c;需要获取一个研究区的Landsat8影像&#xff0c;但Landsat8重复周期长&#xff0c;加之天气的影响&#xff0c;很难获取影像质量较好的影像。Landsat4/5/7的波段顺序与landsat8不同&#xff0c;除此之外&#xff0c;landsat7影像还需要工具进行条带…

【PyQt】08 - 编辑Tab顺序

文章目录 前言一、Tab顺序二、编辑Tab顺序总结 前言 介绍了什么是Tab顺序&#xff0c;以及如何修改Tab顺序。 一、Tab顺序 当你的界面设计好之后&#xff0c;在输入栏按住Tab按键&#xff0c;他会按照你摆放的顺序一次转跳 二、编辑Tab顺序 方法一 然后鼠标左击就可以改变…

阿里云参编业内首个代码大模型标准丨云原生 2024 年 1 月产品技术动态

云原生月度动态 云原生是企业数字创新的最短路径。 《阿里云云原生每月动态》&#xff0c;从趋势热点、产品新功能、服务客户、开源与开发者动态等方面&#xff0c;为企业提供数字化的路径与指南。 趋势热点 &#x1f947; 阿里云参编业内首个代码大模型标准&#xff0c;通…

LLaVA-1.6:多模态AI新标准,中文零样本能力与低成本训练革命,性能全面超越Gemini Pro

引言 2023年10月&#xff0c;LLaVA-1.5凭借其简洁高效的设计和在12个数据集上的出色表现&#xff0c;为大规模多模态模型&#xff08;LMM&#xff09;的研究和应用奠定了基础。进入2024年&#xff0c;我们迎来了LLaVA-1.6&#xff0c;一个在理性推理、光学字符识别&#xff08…

LeetCode1365之切披萨的方案数(相关话题:二维前缀和,动态规划)

题目描述 给你一个 rows x cols 大小的矩形披萨和一个整数 k &#xff0c;矩形包含两种字符&#xff1a; A &#xff08;表示苹果&#xff09;和 . &#xff08;表示空白格子&#xff09;。你需要切披萨 k-1 次&#xff0c;得到 k 块披萨并送给别人。 切披萨的每一刀&#xf…

Bpmn-js自定义Palette元素

Bpmn-js作为一个流程编辑器&#xff0c;常规的我们可以将其划分为几个功能区域&#xff0c;每个区域对应的负责不同的功能实现&#xff0c;bpmn-js的设计给我们留下了大量的留白和可扩展区域&#xff0c;其每一部分都可进行组合拼装&#xff0c;同时也支持我们的各种不同层次需…

『运维备忘录』之 Kubernetes(K8S) 常用命令速查

一、简介 kubernetes&#xff0c;简称K8s&#xff0c;是用8代替名字中间的8个字符“ubernete”而成的缩写&#xff0c;是一个开源的&#xff0c;用于管理云平台中多个主机上的容器化的应用。kubernetes是基于容器技术的分布式架构解决方案&#xff0c;具有完备的集群管理能力&a…

霍金《时间简史》(A Brief History of Time)学习笔记(第四章)

Chapter 4: The Uncertainty Principle Footnote: Chapter 4. Mainly talks about Werner Heisenberg’s Uncertainty Principle. Vital principle in modern physics, concept not hard to understand——work of a genius mind. Footnote: Werner Heisenberg, German physici…

【蓝桥杯冲冲冲】Invasion of the Milkweed G

【蓝桥杯冲冲冲】Invasion of the Milkweed G 蓝桥杯备赛 | 洛谷做题打卡day30 文章目录 蓝桥杯备赛 | 洛谷做题打卡day30[USACO09OCT] Invasion of the Milkweed G题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 题解代码我的一些话 [USACO09OCT] Invasion of the Mi…

斯巴鲁Subaru EDI需求分析

斯巴鲁Subaru是日本运输集团斯巴鲁公司&#xff08;前身为富士重工&#xff09;的汽车制造部门&#xff0c;以性能而闻名&#xff0c;曾赢得 3 次世界拉力锦标赛和 10 次澳大利亚拉力锦标赛。 斯巴鲁Subaru EDI 需求分析 企业与斯巴鲁Subaru建立EDI连接&#xff0c;首先需要确…

洛谷C++简单题小练习day9—[AHOI2017]寻找探监点

day9--[AHOI2017]寻找探监点--2.7 习题概述 题目描述 一个nn 的网格图&#xff08;标号由 1,1 开始&#xff09;上有 m 个探测器&#xff0c;每个探测器有个探测半径 r &#xff0c;问这 nn 个点中有多少个点能被探测到。 输入格式 第一行 3 个整数 n,m,r。 接下来 m 行&…

解决dockor安装nginx提示missing signature key的问题

问题描述 使用dockor安装nginx拉取nginx的时候提示key丢失问题 问题定位 由于dockor版本低导致 问题解决 卸载重新安装最新版本dockor 解决步骤 1. 卸载旧版本的Docker&#xff1a; sudo yum remove docker docker-common docker-selinux docker-engine 2. 安装依赖包&am…

Ubuntu安装SVN服务并结合内网穿透实现公网访问本地存储文件

&#x1f525;博客主页&#xff1a; 小羊失眠啦. &#x1f3a5;系列专栏&#xff1a;《C语言》 《数据结构》 《C》 《Linux》 《Cpolar》 ❤️感谢大家点赞&#x1f44d;收藏⭐评论✍️ 前些天发现了一个巨牛的人工智能学习网站&#xff0c;通俗易懂&#xff0c;风趣幽默&…

线性时间非比较类排序之桶排序

桶排序 桶排序也叫箱排序&#xff0c;1956年便开始使用&#xff0c;它可以算是计数排序的一个改进版本。 1. 算法思想 根据元素的特性将集合拆分为多个值域&#xff0c;我们称之为桶&#xff0c;将同一值域的元素存放在同一个桶内并进行桶内排序使其处于有序状态。如果每个桶…