专门做冷门旅行的网站/360线上推广
Prometheus离线tar包安装
实验环境
一、部署前操作
二、Master
2.1下载
2.2解压
2.3更改服务目录名称
2.4创建系统服务启动文件
2.5配置修改
2.6启动并设置开机自启
2.7访问
2.8添加node节点
2.8.1 添加方法
2.8.2修改Prometheus配置(Master)
————————————————
实验环境
节点 | ip | cpu | 内存 | 磁盘 | 操作系统 |
Master | 192.168.3.233 | 2c | 4G | 50G | Centos7.9 |
node | 192.168.3.236 | 2c | 4G | 50G | Centos7.9 |
一、部署前操作
#1.关闭防火墙
systemctl stop firewalld
setenforce 0
二、Master 安装和配置
2.1下载
wget https://dl.grafana.com/oss/release/grafana-9.0.7.linux-amd64.tar.gz
wget https://github.com/prometheus/prometheus/releases/download/v2.38.0-rc.0/prometheus-2.38.0-rc.0.linux-amd64.tar.gz
wget https://github.com/prometheus/node_exporter/releases/download/v1.4.0-rc.0/node_exporter-1.4.0-rc.0.linux-amd64.tar.gz
2.2解压
tar xf grafana-9.0.7.linux-amd64.tar.gz -C /home
tar xf prometheus-2.38.0-rc.0.linux-amd64.tar.gz -C /home
tar xf node_exporter-1.4.0-rc.0.linux-amd64.tar.gz -C /home
2.3更改服务目录名称
cd /home
mv grafana-9.0.7 grafana
mv prometheus-2.38.0-rc.0.linux-amd64 prometheus
mv node_exporter-1.4.0-rc.0.linux-amd64 node_exporter
2.4创建系统服务启动文件
#2.4.1.grafana
vim /usr/lib/systemd/system/grafana.service
[Unit]
Description=grafana
After=network.target
[Service]
WorkingDirectory=/home/grafana
ExecStart=/home/grafana/bin/grafana-server
[Install]
WantedBy=multi-user.target
#2.4.2.prometheus
vim /usr/lib/systemd/system/prometheus.service
[Unit]
Description=prometheus
After=network.target
[Service]
User=prometheus
Group=prometheus
WorkingDirectory=/home/prometheus
ExecStart=/home/prometheus/prometheus
[Install]
WantedBy=multi-user.target
#2.4.3.node_exporter
vim /usr/lib/systemd/system/node_exporter.service
[Unit]
Description=node_exporter
After=network.target
[Service]
Type=simple
User=root
ExecStart=/home/node_exporter/node_exporter --web.config=/home/node_exporter/config.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target
2.5配置修改
#2.5.1 prometheus
#创建prometheus用户设置不可登陆服务器
useradd -s /sbin/nologin -M prometheus
#授权目录属主属组
chown -R prometheus:prometheus /home/prometheus
vim /home/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: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
basic_auth: #访问9100开启用户登录
username: prometheus
password: 123456
static_configs:
- targets: ["192.168.3.233:9090","192.168.3.233:9100"]
#9090端口是prometheus服务,9100端口是node_exporter服务
#2.5.2 node_exporter
vim /home/node_exporter/config.yml
basic_auth_users:
#用户为prometheus,密码为123456
prometheus: $2y$20$wopw/vyuwARPSU5Qu29Zy.1oda9gs1QhHfpNCWliqpWcAYhRysgqy
#这个密码可以使用htpasswd -nBC 20 '' |tr -d '\:n'这条命令去生成,该命令由httpd-tools这个包提供。
2.6启动并设置开机自启
#2.6.1grafana
systemctl daemon-reload && systemctl restart grafana && systemctl enable grafana
#2.6.2 prometheus
systemctl daemon-reload && systemctl restart prometheus && systemctl enable prometheus
#2.6.3 node_exporter
systemctl daemon-reload && systemctl restart node_exporter && systemctl enable node_exporter
2.7访问
#浏览器访问
#9090为prometheus服务可查看node注册信息
192.168.3.233:9090

#3000为grafana服务也是可视化web页面
192.168.3.233:3000
默认用户密码
admin

第一次登陆提示修改密码,不想修改可以点击Skip跳过

配置prometheus数据源

新增加数据源

点击Prometheus

添加Prometheus信息
URL:http://192.168.3.233:9090



添加完成
开始添加监控的仪表盘

#浏览器打开这个链接下载模板
https://grafana.com/api/dashboards/12884/revisions/1/download

点击Upload JSON file根据下载仪表盘模板的路径选择


至此整个监控安装完毕!!!
2.8添加node节点
2.8.1 添加方法
可以直接复制Master节点上的node_exporter包
#复制程序包
scp -r 192.168.3.233:/home/node_exporter /home
#复制启动文件
scp 192.168.3.233:/usr/lib/systemd/system/node_exporter.service /usr/lib/systemd/system
#启动并设置开机自启
systemctl daemon-reload && systemctl restart node_exporter && systemctl enable node_exporter
#查看端口是否启动
netstat -lantp|grep 9100
tcp6 0 0 :::9100 :::* LISTEN 1631/node_exporter
重新下载node_exporter包,之后按照Master节点安装方式统一修改。
2.8.2修改Prometheus配置(Master)
vim prometheus/prometheus.yml
static_configs:
- targets: ["192.168.3.233:9090","192.168.3.233:9100","192.168.3.236:9100"]
#重启Prometheus服务
systemctl restart prometheus
登陆Master节点查看添加状态

登陆grafana查看监控状态

至此节点加入Master监控完毕!!!
相关文章:

Prometheus离线tar包安装
Prometheus离线tar包安装实验环境一、部署前操作二、Master2.1下载2.2解压2.3更改服务目录名称2.4创建系统服务启动文件2.5配置修改2.6启动并设置开机自启2.7访问2.8添加node节点2.8.1 添加方法2.8.2修改Prometheus配置(Master)————————————…...

PostgreSQL查询引擎——SELECT STATEMENTS SelectStmt
SelectStmt: select_no_parens %prec UMINUS| select_with_parens %prec UMINUS select_with_parens:( select_no_parens ) { $$ $2; }| ( select_with_parens ) { $$ $2; } 该规则返回单个SelectStmt节点或它们的树,表示集合操作树(set-operation tree…...

零信任-易安联零信任介绍(11)
目录 易安联零信任公司介绍 易安联零信任发展路线 易安联零信任产品介绍 易安联零信任架构 易安联零信任解决方案 易安联零信任发展展望 易安联零信任公司介绍 易安联是一家专业从事网络信息安全产品研发与销售,是行业内领先的“零信任”解决方案提供商&…...

C++ STL——map和set的使用
文章目录1. 关联式容器1.1 键值对1.2 树形结构的关联式容器2. set2.1 set的介绍2.2 set的插入2.3 set的删除和查找2.4 lower_bound和upper_bound3. multiset3.1 count4. map4.1 map的介绍4.2 map的插入4.3 map的遍历4.4 map的[ ]5. multimap1. 关联式容器 我们之前学的vector、…...

【Python】thread使用
目录1、Condition条件变量使用2、event通信3、Semaphore信号量使用4、setDaemon设置守护线程5、threadPool_map使用6、threadPool使用7、threadingTimer1、Condition条件变量使用 # encoding:utf-8 Condition 提供了一种多线程通信机制, 假如线程 1 需要数据&#…...

计网传输层协议:UDP和TCP
文章目录一. 应用层和传输层的联系二. UDP协议三. TCP协议1. TCP报头介绍2. TCP实现可靠传输的核心机制2.1 确认应答2.2 超时重传3. 连接管理(三次握手, 四次挥手)3.1 建立连接(三次握手)3.2 断开连接(四次挥手)4. 滑动窗口5. 流量控制6.拥塞控制7. 延时应答8. 捎带应答9. 面向…...

一文讲明TCP网络编程、Socket套接字的讲解使用、网络编程案例
文章目录1 Socket讲解2 基于Socket的TCP编程3 客户端Socket的工作过程包含以下四个基本的步骤3.1 客户端创建Socket对象4 服务器程序的工作过程包含以下四个基本的步骤:4.1 服务器建立ServerSocket对象5 案例实现 客户端和服务端通信5.1 代码实现5.2 实现结果6 更多…...

Java中print和println的区别
1 问题在最开始学习Java的时候学到soutenter键可以输出结果,显示的是System.out.println();而在Python中是直接使用print。那么在Java中print和println有什么区别?2 方法Print输出会自动将括号中的内容转换成字符串输出,如果括号中…...

RocketMq使用规范(纯技术和实战建议)
概述: 使用规范主要从,生产、可靠性、和消费为轴线定义使用规范;kafka使用核心:削峰、解耦、向下游并行广播通知(无可靠性保证)和分布式事务,本规范仅从削峰、解耦、向下游并行广播通知论述&am…...

matlab离散系统仿真分析——电机
目录 1.电机模型 2.数字PID控制 3.MATLAB数字仿真分析 3.1matlab程序 3.2 仿真结果 4. SIMULINK仿真分析 4.1simulink模型 4.2仿真结果 1.电机模型 即: 其中:J 0.0067;B 0.10 2.数字PID控制 首先我们来看一下连续PID࿱…...

一文学会进程控制
目录进程的诞生fork函数fork的本质fork的常规用法fork调用失败的原因进程的死亡进程退出的场景常见的进程退出方法正常终止(代码跑完)echo $?main函数返回调用exit调用_exitexit和_exit的区别进程等待进程等待的重要性进程等待的函数waitwaitpid进程退出…...

5.2 BGP水平分割
5.2.2实验2:BGP水平分割 1. 实验目的 熟悉BGP水平分割的应用场景掌握BGP水平分割的配置方法 2. 实验拓扑 实验拓扑如图5-2所示: 图5-2:BGP水平分割 3. 实验步骤 (1)配置IP地址 R1的配置 <Huawei>…...

华为OD机试 - TLV 编码 | 备考思路,刷题要点,答疑 【新解法】
最近更新的博客 【新解法】华为OD机试 - 关联子串 | 备考思路,刷题要点,答疑,od Base 提供【新解法】华为OD机试 - 停车场最大距离 | 备考思路,刷题要点,答疑,od Base 提供【新解法】华为OD机试 - 任务调度 | 备考思路,刷题要点,答疑,od Base 提供【新解法】华为OD机试…...

【C语言每日一题】——猜名次
【C语言每日一题】——猜名次😎前言🙌猜名次🙌解题思路分享:😍解题源码分享:😍总结撒花💞😎博客昵称:博客小梦 😊最喜欢的座右铭:全神…...

Agilent E4982A、Keysight E4982A、LCR 表,1 MHz 至 3 GHz
Agilent E4982A、Keysight E4982A、HP E4982A LCR 表,1 MHz 至 3 GHz 产品概览 KEYSIGHT E4982A(安捷伦) Keysight E4982A LCR 表为需要高频(1 MHz 至 3 GHz)阻抗测试的无源元件制造行业提供一流的性能,…...

SAP 系统的配置传输
在SAP项目的实施过程中,经常会遇到关于配置传输的问题。即我们在某个client下面做系统配置,配好了之后再传到其他系统之中。 配置传输分为两种情况:同服务器配置传输,异服务器配置传输。同服务器配置传输: 在DEV配置cl…...

华为OD机试 - 喊七(Python)
喊七 题目 喊 7,是一个传统的聚会游戏, N 个人围成一圈,按顺时针从1 - 7编号, 编号为1的人从1开始喊数, 下一个人喊得数字是上一个人喊得数字+1, 但是当将要喊出数字7的倍数或者含有7的话, 不能喊出,而是要喊过。 假定N个人都没有失误。 当喊道数字k时, 可以统计每…...

Docker下快速搭建RabbitMQ单例及集群
引子生命在于折腾,为上数据实时化用到了消息传送的内容,当时也和总公司人员商量选型,kafka不能区分分公司就暂定用了RbtMQ刚好个人也在研究容器及分布式部署相关内容就在docker上实践单机 docker(要想快 先看问题 避免踩坑&#x…...

python代码写开心消消乐
♥️作者:小刘在C站 ♥️个人主页:小刘主页 ♥️每天分享云计算网络运维课堂笔记,努力不一定有收获,但一定会有收获加油!一起努力,共赴美好人生! ♥️夕阳下,是最美的绽放,树高千尺,落叶归根人生不易,人间真情 目录 一.python是什么 二.游戏代码效果呈现 三.主代...

【郭东白架构课 模块一:生存法则】09|法则四:为什么要顺应技术的生命周期?
你好,我是郭东白。今天我们来讲架构师的第四条生存法则,那就是尊重技术的生命周期。 人类的各种活动都要遵循事物的客观生命周期。不论是农业社会种田打渔,还是资本社会投资创业,行动太早或太晚,都会颗粒无收。技术也…...

Linux之进程控制
一.进程创建 1.1 fork函数 我们创建进程的方式有./xxx和fork()两种 在linux中fork函数时非常重要的函数,它从已存在进程中创建一个新进程。新进程为子进程,而原进程为父进程。 #include <unistd.h> pid_t fork(void); 返回值:自进程…...

SpringBoot社区版专业版带你配置热部署
💟💟前言 友友们大家好,我是你们的小王同学😗😗 今天给大家打来的是 SpringBoot社区版专业版带你配置热部署 希望能给大家带来有用的知识 觉得小王写的不错的话麻烦动动小手 点赞👍 收藏⭐ 评论…...

影响AFE采样精度的因素有哪些?
**AFE(Analog Front End)**是模拟前端电路的缩写,它是模拟信号传感器和数字信号处理器之间的连接点。AFE采样精度是指模拟信号被数字化后的准确度,对于很多电子设备来说,这是一个至关重要的性能指标。本文将介绍影响AF…...

mysqlbackup备份报error:redo log was overwritten
问题原因 备份时redo log被覆盖 解决方案 方法1:增加innodb_log_file_size、innodb_log_files_in_group大小,需要重启数据库 vi my.cnf innodb_log_file_size 2G innodb_log_files_in_group 4 方法2: 动态配置redo log archive,不需要重启…...

Android支持库
# 支持库 注意:Android 9.0(API 级别 28)发布后,新版支持库 AndroidX 也随之诞生,它属于 Jetpack。除了现有的支持库,AndroidX 库还包含最新的 Jetpack 组件。 您可以继续使用此支持库以往的工件(这里指的是版本 27 及更早版本,且已打包为 android.support.*)在 Googl…...

Vue:filters过滤器
日期、时间格式化是Vue前端项目中较为常遇到的一个需求点,此处,围绕Vue的过滤器来介绍如何更为优雅的解决此类需求。 过滤器filters使用注意点 Vue允许开发者自定义过滤器,可以实现一些常见的文本格式化等需求。 使用时要注意的点在于&#…...

Windows环境下安装和配置Gradle
1. 概述 Gradle是Google公司基于JVM开发的一款项目构建工具,支持Maven,JCenter多种第三方仓库,支持传递性依赖管理,使用更加简洁和支持多种语言的build脚步文件,更多详情可以参阅Gradle官网 2. 下载 由于Gradle与S…...

数据结构时间空间复杂度笔记
🕺作者: 迷茫的启明星 本篇内容:数据结构时间空间复杂度笔记 😘欢迎关注:👍点赞🙌收藏✍️留言 🏇家人们,码字不易,你的👍点赞🙌收藏❤…...

基于注意力的知识蒸馏Attention Transfer原理与代码解析
paper:Paying More Attention to Attention: Improving the Performance of Convolutional Neural Networks via Attention Transfercode:https://github.com/megvii-research/mdistiller/blob/master/mdistiller/distillers/AT.py背景一个流行的假设是存…...

利尔达在北交所上市:总市值突破29亿元,叶文光为董事长
2月17日,利尔达科技集团股份有限公司(下称“利尔达”,BJ:832149)在北京证券交易所上市。本次上市,利尔达的发行价格为5.00元/股,发行数量为1980万股,发行市盈率为12.29倍,募资总额为…...