Prometheus 监控套件

CentOS7.8-搭建Prometheus+Grafana Prometheus由Go语言编写而成,采用Pull方式获取监控信息,并提供了多维度的数据模型和灵活的查询接口。Prometheus不仅可以通过静态文件配置监控对象,还支持自动发现机制,能通过Kubernetes、Consl、DNS等多种方式动态获取监控对象。在数据采集方面,借助Go语言的高并发特性,单机Prometheus可以采取数百个节点的监控数据;在数据存储方面,随着本地时序数据库的不断优化,单机Prometheus每秒可以采集一千万个指标,如果需要存储大量的历史监控数据,则还支持远程存储。 阅读详情

CentOS 7 安装 Prometheus 监控套件全过程总结

一、环境信息与目标组件版本

1. 系统环境

  • 操作系统:CentOS 7(x86_64)

  • 核心依赖:yum 包管理器、systemd 服务管理、curl/wget 下载工具

2. 目标组件及版本

组件版本功能监听端口
Prometheus2.45.0监控核心(数据采集与存储)9090
Node Exporter1.6.1主机系统监控(CPU / 内存 / 磁盘)9100
MySQL Exporter0.15.0MySQL 数据库监控9104
Grafana12.1.1监控可视化面板3000

二、安装前准备(解决依赖与环境配置)

CentOS 7 官方源已停止维护,需先修复 YUM 源;同时配置网络、权限等基础环境,避免后续组件安装失败。

1. 修复 YUM 源(关键步骤)

操作命令与注释
\# 1. 进入 YUM 源配置目录

cd /etc/yum.repos.d/

\# 2. 删除原有失效的 repo 文件(风险操作,需确认无自定义重要源)

rm -rf \*

\# 3. 下载阿里云 CentOS 7 镜像源(推荐,稳定性高)

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

\# 4. 下载 EPEL 扩展源(后续安装依赖可能需要,原命令“yum install epel”有误,需修正)

yum install -y epel-release

\# 5. 清理旧缓存并生成新缓存

\# 6. 非阿里云ECS用户会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。用户也可自行修改相关配置: eg:

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo


yum clean all

yum makecache
注意事项
  • 若 curl 命令不存在,先执行 yum install -y curl;

  • 避免使用错误的 repo URL(如用户曾误用清华源的 help 页面 URL),正确第三方源地址需从镜像站官方文档获取(如阿里云、清华源的 CentOS 7 专区);

  • 若 yum makecache 失败,优先检查 DNS 解析(见下一步)。

2. 配置 DNS 与禁用 NetworkManager

操作命令与注释
\# 1. 写入阿里云/114 公共 DNS(避免解析镜像站失败)

echo "nameserver 223.5.5.5" > /etc/resolv.conf  # 阿里云 DNS

echo "nameserver 223.6.6.6" >> /etc/resolv.conf # 阿里云 DNS

echo "nameserver 114.114.114.114" >> /etc/resolv.conf # 114 DNS

\# 2. 停止并禁用 NetworkManager(避免其自动覆盖 resolv.conf)

systemctl stop NetworkManager        # 立即停止服务

systemctl disable NetworkManager     # 禁止开机自启(原注释“立即停止”有误,此处修正)

\# 3. 重启网络服务使 DNS 生效

systemctl restart network

\# 4. 验证 DNS 解析(确保能解析镜像站)

getent hosts mirrors.aliyun.com

ping mirrors.aliyun.com -c 4         # 测试网络连通性
注意事项
  • NetworkManager 是核心坑点:CentOS 7 中 NetworkManager 会自动管理网络配置,可能覆盖手动写入的 resolv.conf,导致 DNS 解析失效(表现为 yum 或 wget 无法访问外部地址),必须禁用;

  • 若 ping 失败,检查网关配置(cat /etc/sysconfig/network-scripts/ifcfg-eth0),确保网络通畅。

3. 关闭 SELinux 与开放防火墙端口

操作命令与注释
\# 1. 临时关闭 SELinux(立即生效,无需重启)

setenforce 0

\# 2. 永久关闭 SELinux(重启后生效,避免后续服务端口被拦截)

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

\# 3. 开放监控套件所需端口(永久生效)

firewall-cmd --zone=public --add-port=9090/tcp --permanent  # Prometheus

firewall-cmd --zone=public --add-port=9100/tcp --permanent  # Node Exporter

firewall-cmd --zone=public --add-port=9104/tcp --permanent  # MySQL Exporter

firewall-cmd --zone=public --add-port=3000/tcp --permanent  # Grafana

\# 4. 重载防火墙规则(使端口配置生效)

firewall-cmd --reload

\# 5. 安装基础工具(后续下载/解压需用到)

yum install -y wget tar vim curl lsof
注意事项
  • SELinux 若未关闭,会拦截 Prometheus/Node Exporter 绑定端口(表现为 systemctl start 失败,日志提示 “permission denied”);

  • 防火墙端口必须开放,否则外部无法访问 Prometheus(http://IP:9090)和 Grafana(http://IP:3000)界面。

三、组件安装与配置(按顺序执行)

1. Prometheus 安装与配置

操作命令与注释
\# 1. 创建 Prometheus 系统用户(无登录权限,安全性更高)

useradd -r -m -s /sbin/nologin prometheus

\# 2. 创建 Prometheus 目录(配置文件/数据/日志)

mkdir -p /etc/prometheus /var/lib/prometheus /var/log/prometheus

\# 3. 授权目录归属(避免权限不足)

chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus /var/log/prometheus

\# 4. 下载并解压 Prometheus 二进制包(/tmp 为临时目录,避免占用根目录)

cd /tmp

wget https://github.com/prometheus/prometheus/releases/download/v2.45.0/prometheus-2.45.0.linux-amd64.tar.gz

tar -zxvf prometheus-2.45.0.linux-amd64.tar.gz

cd prometheus-2.45.0.linux-amd64

\# 5. 复制二进制文件到系统路径(便于全局调用)

cp prometheus promtool /usr/local/bin/

chown prometheus:prometheus /usr/local/bin/prometheus /usr/local/bin/promtool

\# 6. 复制配置文件与静态资源(Web 界面依赖)

cp prometheus.yml /etc/prometheus/

cp -r consoles/ console\_libraries/ /etc/prometheus/

chown -R prometheus:prometheus /etc/prometheus/

\# 7. 创建 systemd 服务文件(便于管理启停)

cat > /etc/systemd/system/prometheus.service << EOF
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
Group=prometheus
Type=simple
# 启动参数:指定配置文件、数据存储路径、Web 监听地址
ExecStart=/usr/local/bin/prometheus \
  --config.file=/etc/prometheus/prometheus.yml \
  --storage.tsdb.path=/var/lib/prometheus \
  --web.console.templates=/etc/prometheus/consoles \
  --web.console.libraries=/etc/prometheus/console_libraries \
  --web.listen-address=0.0.0.0:9090

[Install]
WantedBy=multi-user.target
EOF


\# 8. 启动并设置开机自启

systemctl daemon-reload  # 重新加载 systemd 配置

systemctl start prometheus

systemctl enable prometheus

\# 9. 验证服务状态(确保“active (running)”)

systemctl status prometheus
关键配置文件:/etc/prometheus/prometheus.yml
# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
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(需替换为实际 IP)
  - job_name: 'node'
    static_configs:          # 修正:缩进 4 个空格(与 job_name 对齐)
      - targets: ['192.168.200.200:9100']  # 修正:缩进 8 个空格(在 static_configs 下)
注意事项
  • YAML 缩进错误是高频坑:scrape_configs 下的 job_name 需缩进 2 空格,static_configs 需缩进 4 空格,targets 需缩进 6 空格;若缩进错误,服务启动失败,可通过 journalctl -u prometheus -xe 查看日志报错;

  • 若 wget 下载失败(GitHub 访问慢),可替换为 HTTP 协议(http://github.com/...)或国内镜像(如 https://mirrors.huaweicloud.com/github-release/...)。

2. Node Exporter 安装与配置(监控主机系统)

操作命令与注释
\# 1. 进入临时目录下载二进制包

cd /tmp

wget https://github.com/prometheus/node\_exporter/releases/download/v1.6.1/node\_exporter-1.6.1.linux-amd64.tar.gz

\# 2. 解压并复制二进制文件

tar -zxvf node\_exporter-1.6.1.linux-amd64.tar.gz

cd node\_exporter-1.6.1.linux-amd64

cp node\_exporter /usr/local/bin/

chown prometheus:prometheus /usr/local/bin/node\_exporter

\# 3. 创建 systemd 服务文件

cat > /etc/systemd/system/node_exporter.service << EOF
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
# 启动参数:启用系统/进程/磁盘监控,监听 9100 端口
ExecStart=/usr/local/bin/node_exporter \
 --collector.systemd \
 --collector.processes \
 --collector.diskstats \
 --web.listen-address=0.0.0.0:9100
[Install]
WantedBy=multi-user.target
EOF


\# 4. 启动并设置开机自启

systemctl daemon-reload

systemctl start node\_exporter

systemctl enable node\_exporter

\# 5. 验证服务状态

systemctl status node\_exporter
注意事项
  • Node Exporter 依赖 prometheus 用户权限,若提示 “permission denied”,检查 /usr/local/bin/node_exporter 的归属;

  • 启用 --collector.systemd 可监控系统服务状态(如 node_systemd_unit_state 指标),需确保 prometheus 用户有权限访问 systemd 接口。

3. MySQL Exporter 安装与配置(监控 MySQL)

操作命令与注释(用户原操作遗漏部分已补充)
\# 1. 进入临时目录下载二进制包

cd /tmp

wget https://github.com/prometheus/mysqld\_exporter/releases/download/v0.15.0/mysqld\_exporter-0.15.0.linux-amd64.tar.gz

\# 2. 解压并复制二进制文件

tar -zxvf mysqld\_exporter-0.15.0.linux-amd64.tar.gz

cd mysqld\_exporter-0.15.0.linux-amd64

cp mysqld\_exporter /usr/local/bin/

chown prometheus:prometheus /usr/local/bin/mysqld\_exporter

\# 3. 【关键】创建 MySQL 连接配置文件(用户原操作遗漏,必须补充)

mkdir -p /etc/mysqld\_exporter

cat > /etc/mysqld_exporter/.my.cnf << EOF

[client]
user=exporter_user # MySQL 监控用户(需提前在 MySQL 中创建)
password=Exporter@123 # 密码
host=127.0.0.1 # MySQL 地址(本地填 127.0.0.1,远程填实际 IP)
port=3306 # MySQL 端口
EOF

\# 4. 授权配置文件(避免密码泄露)

chown -R prometheus:prometheus /etc/mysqld\_exporter/

chmod 600 /etc/mysqld\_exporter/.my.cnf  # 仅所有者可读

\# 5. 创建 systemd 服务文件

cat > /etc/systemd/system/mysqld\_exporter.service << EOF

[Unit]
Description=MySQL Exporter
Wants=network-online.target
After=network-online.target mysql.service 
# 依赖 MySQL 服务
[Service]
User=prometheus
Group=prometheus
Type=simple
# 启动参数:指定 MySQL 连接配置文件,监听 9104 端口
ExecStart=/usr/local/bin/mysqld_exporter \
 --config.my-cnf=/etc/mysqld_exporter/.my.cnf \
 --web.listen-address=0.0.0.0:9104
[Install]
WantedBy=multi-user.target
EOF

\# 6. 启动并设置开机自启

systemctl daemon-reload

systemctl start mysqld\_exporter

systemctl enable mysqld\_exporter

\# 7. 验证服务状态

systemctl status mysqld\_exporter
前置要求(MySQL 端配置)

需在 MySQL 中创建监控用户并授权:

CREATE USER 'exporter\_user'@'localhost' IDENTIFIED BY 'Exporter@123';

GRANT PROCESS, REPLICATION CLIENT, SELECT ON \*.\* TO 'exporter\_user'@'localhost';

FLUSH PRIVILEGES;
注意事项
  • 用户原操作遗漏连接配置:MySQL Exporter 必须通过 --config.my``-cnf 指定 MySQL 账号密码,否则无法采集数据,服务虽启动但无指标输出;

  • 若提示 “access denied”,检查 MySQL 用户权限、密码正确性,或远程连接时的 IP 白名单。

4. Grafana 安装与配置(可视化面板)

操作命令与注释
\# 1. 添加 Grafana 官方 YUM 源
cat > /etc/yum.repos.d/grafana.repo << EOF
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
EOF


\# 2. 安装 Grafana

yum install -y grafana

\# 3. 【修复权限】用户原操作遇到启动失败,需授权数据目录

chown -R grafana:grafana /var/lib/grafana/

chmod -R 755 /var/lib/grafana/

\# 4. 【清理插件缓存】若提示插件错误,删除缓存目录

rm -rf /var/lib/grafana/plugins/.cache

\# 5. 启动并设置开机自启

systemctl start grafana-server

systemctl enable grafana-server

\# 6. 验证服务状态

systemctl status grafana-server

\# 7. 查看日志排查错误(若启动失败)

cat /var/log/grafana/grafana.log | grep -i "error"

[root@Test ~]# cat /var/log/grafana/grafana.log | grep -i "error"
logger=migrator t=2025-08-26T17:05:37.378880923+08:00 level=info msg="Executing migration" id="add snapshot error_string column"
logger=migrator t=2025-08-26T17:05:37.386846059+08:00 level=info msg="Migration successfully executed" id="add snapshot error_string column" duration=7.961711ms
logger=migrator t=2025-08-26T17:05:37.484979331+08:00 level=info msg="Executing migration" id="add cloud_migration_resource.error_code column"
logger=migrator t=2025-08-26T17:05:37.492673825+08:00 level=info msg="Migration successfully executed" id="add cloud_migration_resource.error_code column" duration=7.689799ms
logger=renderer.manager t=2025-08-26T17:05:37.848383107+08:00 level=error msg="Failed to get renderer plugin sources" error="failed to open plugins path"
logger=plugin.sources t=2025-08-26T17:05:38.064594561+08:00 level=error msg="Failed to load external plugins" error="failed to open plugins path"
logger=plugins.registration t=2025-08-26T17:05:38.095987054+08:00 level=error msg="Could not register plugin" pluginId=table error="plugin table is already registered"
logger=plugins.initialization t=2025-08-26T17:05:38.096063152+08:00 level=error msg="Could not initialize plugin" pluginId=table error="plugin table is already registered"
logger=renderer.manager t=2025-08-26T17:05:38.150109925+08:00 level=error msg="Failed to get renderer plugin sources" error="failed to open plugins path"



# 1. 停止 Grafana 服务
systemctl stop grafana-server

# 2. 检查并创建默认插件目录(若不存在)
if [ ! -d "/var/lib/grafana/plugins" ]; then
  mkdir -p /var/lib/grafana/plugins
fi

# 3. 授权插件目录(确保 Grafana 进程有权访问)
chown -R grafana:grafana /var/lib/grafana/plugins
chmod -R 755 /var/lib/grafana/plugins  # 只读权限,避免误改
初始访问与配置
  1. 访问 Grafana 界面:http://IP:3000;

  2. 初始账号密码:admin / admin(首次登录需修改密码);

  3. 添加 Prometheus 数据源:

  • 左侧菜单 → Data Sources → Add data source → 选择 Prometheus;

  • URL 填写 http://localhost:9090(若 Grafana 与 Prometheus 同主机),点击 Save & Test;
    在这里插入图片描述
    在这里插入图片描述

  1. 导入 Node Exporter 仪表盘:
  • 左侧菜单 → Dashboards → Import → 输入仪表盘 ID(如官方 Node Exporter 仪表盘 ID:1860),选择 Prometheus 数据源,完成导入。

    方法二:手动导入 1860 仪表盘(Node Exporter Full)
    获取 JSON 文件:https://grafana.com/grafana/dashboards/1860-node-exporter-full/
    点击右侧 Download JSON 按钮(若提示登录,注册一个免费账号即可),保存文件(如 1860_rev28.json)
    在这里插入图片描述

注意事项
  • Grafana 启动失败高频原因:
  1. 数据目录权限不足(/var/lib/grafana/ 归属 root 而非 grafana),解决:chown -R grafana:grafana /var/lib/grafana/;

  2. 插件缓存冲突,解决:删除 /var/lib/grafana/plugins/.cache 后重启;

  3. 端口被占用,解决:用 lsof -i:3000 查找占用进程,杀死后重启。

四、常见易错点、原因及解决方法

易错点描述根本原因解决方法
YUM 源 yum makecache 失败原有 repo 文件失效,或 DNS 解析失败重新下载阿里云 / 清华 CentOS 7 repo;配置公共 DNS(223.5.5.5),禁用 NetworkManager
Prometheus/Node Exporter 启动失败SELinux 拦截端口,或配置文件缩进错误临时 setenforce 0 + 永久关闭 SELinux;用 yamllint 检查 YAML 缩进
Grafana 访问白屏或启动失败数据目录权限不足,或插件缓存冲突chown -R grafana:grafana /var/lib/grafana/;删除 /var/lib/grafana/plugins/.cache
MySQL Exporter 无指标输出未配置 MySQL 连接文件,或用户权限不足创建 /etc/mysqld_exporter/.my.cnf;在 MySQL 中给监控用户授权 PROCESS, SELECT 权限
GitHub 下载二进制包超时网络限制(GitHub 访问慢)改用 HTTP 协议下载;或用国内镜像(华为云、阿里云 GitHub 镜像);手动下载后上传
外部无法访问 Prometheus/Grafana 界面防火墙端口未开放,或服务器 IP 配置错误执行 firewall-cmd --add-port=9090/tcp --permanent && firewall-cmd --reload;检查服务器 IP 是否为内网可访问

五、验证步骤

  1. 验证 Prometheus 服务:
  • 访问 http://服务器IP:9090,查看界面是否正常;

  • 进入 Status → Targets,确认 prometheus 和 node 目标状态为 UP。

  1. 验证 Node Exporter 指标:
  • 访问 http://服务器IP:9100/metrics,查看是否输出主机监控指标(如 node_cpu_seconds_total)。
  1. 验证 MySQL Exporter 指标:
  • 访问 http://服务器IP:9104/metrics,查看是否输出 MySQL 指标(如 mysql_up)。
  1. 验证 Grafana 可视化:
  • 访问 http://服务器IP:3000,登录后导入仪表盘 ID 1860(Node Exporter),查看主机 CPU、内存等图表是否正常显示。
Prometheus社区Helm Charts仓库:Kubernetes监控部署权威指南 在云原生监控领域,Prometheus已成为事实上的标准,而Helm作为Kubernetes的包管理器,通过Chart封装极大简化了应用部署的复杂度。其核心原理是将应用配置、依赖关系和部署逻辑模板化,实现一键部署和版本控制,这为大规模容器化环境下的运维工作带来了革命性效率提升。从技术价值看,Helm Charts不仅解决了部署标准化问题,更通过社区维护的官方仓库确保了安全性和持续更新,这对于生产环境的稳定性至关重要。在实际应用场景中,监控系统的部署尤为复杂,涉及Prometheus Server、Alert 阅读详情

相关推荐

Centos8快速搭建Prometheus系统

#1-在opt目录下创建prometheus文件夹命令 mkdir -p /opt/prometheus #2-下载2.37.6长期支持版本的prometheus命令 wget https://github.com/prometheus/prometheus/releases/download/v2.37.6/prometheus-2.37.6.linux-amd64.tar.gz #3-解压下载的2.37.6长期支持版prometheus压缩包命令 tar xf prometheus-2.37.6.l

提供C#相关开发 、云计算、运维测试、网络安全相关技术分享与服务,有意向可联系。 577

Centos环境下Prometheus监控的部署

Prometheus(普罗米修斯)是由 SoundCloud 开源的监控告警解决方案,自2012年成为社区开源项目,拥有非常活跃的开发人员和用户社区。同时为强调开源及独立维护,Prometheus于2016年加入云原生云计算基金会(CNCF),成为继Kubernetes之后的第二个托管项目。官方网站:https://prometheus.io项目托管:https://github.com/prometheus。

u010100623的博客 2354

Phantom Omni的力与力矩操作

*本说明为对Phantom Omni的力与力矩操作 ****************虚拟夹具的力读取与控制************************ 1、首先力的读取要声明【全局变量】 hduVector3Dd F;//三维矢量力(x,y,z三个方向的力) 2、对力的控制可以采用配置函数Set()与Get()函数; 3、对力觉的控制或读取操作需要放到【回调帧】开始与结束之间,如例子

xuliang355的博客 2562

centos搭建Prometheus基础

centos搭建prometheus基础

m0_66882283的博客 1320

手把手教你用ESP32驱动MAX30102心率血氧传感器(含完整代码)

本文详细介绍了如何使用ESP32微控制器驱动MAX30102心率血氧传感器,构建智能健康监测系统。内容涵盖PPG原理、硬件连接、驱动配置、信号处理算法以及Web服务器数据可视化,提供完整代码实现,帮助开发者快速上手物联网健康设备开发。

weixin_29208077的博客 588

3D坐标系转换实战:如何用Python快速实现旋转矩阵与平移向量的组合变换

本文详细介绍了如何使用Python和NumPy实现3D坐标系转换中的旋转矩阵与平移向量的组合变换。通过齐次坐标和变换矩阵的数学原理,结合代码示例,帮助开发者高效处理机器人路径规划和计算机视觉中的空间变换问题,并解决实际应用中的常见错误。

pluto的博客 960

centos7安装prometheus

② 通过浏览器访问http://被监控端IP:9100/metrics就可以查看到 node_exporter在被监控端收集的监控信息。③ 回到web管理界面 --》点Status --》点Targets --》可以看到监控mariadb了。④ 回到web管理界面 --》点Status --》点Targets --》可以看到多了一台监 控目标。下载地址: https://prometheus.io/download/下载地址: https://prometheus.io/download/

l99670的博客 2057

(10)Proteus 8.9上的STM32仿真系列(HAL)---freertos

实验设计:通过cubemxide生成freertos工程,然后创建一个 pc13 led灯间隔200ms闪烁的任务。非常遗憾的是proteus8.9仿真失败,实物上没有问题,但还是把流程过一遍。 一、原理图 实物是淘宝上stm32f103 c8t6的核心板,proteus上没有这个芯片,这里图上大概表示一下,用的是核心板自带的pc13引脚的led灯。 二、cubemxide配置 1.RCC如之前工程一样配置 2、配置SYS timebase Source不要使用systick,自己选择一个定时器,我这

qq_35442550的博客 7344

Kuboard监控套件:Prometheus+Grafana全方位监控

Kuboard监控套件:Prometheus+Grafana全方位监控 Kuboard资源层监控套件采用现代化的云原生监控架构,基于Prometheus Operator和Grafana构建,为Kubernetes集群提供全方位的资源监控能力。该架构设计充分考虑了可扩展性、可靠性和易用性,实现了从基础设施到应用层的完整监控覆盖。套件包含数据采集层、数据处理层和可视化与告警层,通过模块化设计、服务发...

gitblog_01026的博客 986

手把手教你学Simulink--移动机器人多轮协同场景实例:基于Simulink的双轮差速PMSM轮毂电机协同驱动仿真

本文介绍了基于Simulink的双轮差速PMSM轮毂电机协同驱动仿真系统。针对移动机器人存在的电机参数不一致、负载分配不均等问题,提出主从同步+力矩补偿的协同控制策略。通过搭建包含运动学模型、PMSM电机模型和矢量控制器的仿真系统,实现了速度同步误差<0.005m/s、轨迹跟踪误差<0.8cm、能耗降低12.5%的优化效果。文章详细阐述了建模步骤、核心算法实现和性能验证,为移动机器人动力系统设计提供了实用参考方案。

MHD0815的博客 133

8、鼠疫流行过程的计算机建模介绍

本博文介绍了一种基于概率细胞自动机和蒙特卡罗方法的计算机模型,用于模拟由大沙鼠传播的鼠疫流行过程。结合GIS和遥感技术,该模型能够分析鼠疫在不同聚居地类型和季节变化下的传播特征,揭示了群落密度、分布及流行接触率对鼠疫传播的影响。研究还验证了模型与自然流行过程的一致性,并探讨了鼠疫在宿主数量低谷时的持续机制。模型为鼠疫防控和流行病研究提供了定量分析工具。

x2y3z4a5b的博客 107

探索全面监控新时代:Prometheus + Grafana Docker Compose套件

探索全面监控新时代:Prometheus + Grafana Docker Compose套件 在数字化时代,实时系统监控对于确保服务高可用性至关重要。今天,我们特别推荐一个开源宝藏——基于Prometheus与Grafana的Docker Compose套件,这是一站式解决方案,专为快速部署网站监控而设计。 项目介绍 此项目提供了一个简单的入门方案,通过Docker容器化技术,您可以在几分钟内搭...

gitblog_00002的博客 365

【YOLO系列】YOLOv8详解:模型结构、损失函数、训练方法及代码实现

YOLOv8是Ultralytics团队2023年推出的高效目标检测框架,在速度与精度平衡、多任务支持和易用性方面实现突破。模型采用改进的CSPDarknet主干网络、C2f模块和SPPF加速结构,结合PAN-FPN特征融合和解耦检测头设计,支持目标检测、实例分割和关键点检测任务。创新性地使用CIoU定位损失、Focal Loss置信度损失和动态样本分配策略,显著提升检测性能。实验表明,YOLOv8较前代模型mAP提升5-10%,在TensorRT加速下可达1000FPS,提供5种尺寸灵活选择,成为实时目标

一碗白开水一 2779

Prometheus监控(kube-prometheus)

部署kube-prometheus监控套件 中文文档 This repository collects Kubernetes manifests, Grafana dashboards, and Prometheus rules combined with documentation and scripts to provide easy to operate end-to-end Kubernetes cluster monitoring with Prometheus using the Prometh

运维求生之路 6373

[系统安全] 一.什么是逆向分析、逆向分析基础及经典扫雷游戏逆向

娜璋AI安全之家于2020年8月18日开通,将专注于Python和安全技术,主要分享Web渗透、系统安全、CVE复现、威胁情报分析、人工智能、大数据分析、恶意代码检测等文章。真心想把自己近十年的所学所做所感分享出来,与大家一起进步。 系统安全系列作者将深入研究恶意样本分析、逆向分析、攻防实战等,通过在线笔记和实践操作的形式分享与博友们学习,希望能与您一起进步。第一篇文章先带领大家学习什么是逆向分析,然后详细讲解逆向分析的典型应用,接着通过OllyDbg工具逆向分析经典的游戏扫雷,再通过Cheat Engin

杨秀璋的专栏 2万+

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Kuboard部署Prometheus+Grafana

利用kuboard里的监控套件部署prometheus+grafana来监控kubernates

CLASSXY的博客 1509

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

运维监控工具Top10深度解析:从Prometheus到商业套件的选型指南

在系统稳定性保障中,运维监控是核心环节,其本质是通过数据采集、处理与可视化,实现对IT基础设施与应用状态的实时洞察。其技术原理通常围绕指标(Metrics)、日志(Logs)与追踪(Traces)三大支柱展开,通过代理(Agent)或拉取(Pull)模式收集数据,并借助灵活的告警规则与可视化仪表盘,将原始数据转化为可操作的运维决策依据。这一技术体系的价值在于,它能提前预警故障、辅助性能优化,并最终保障业务连续性。其应用场景广泛,从传统数据中心的基础设施监控,到云原生环境下的微服务可观测性,都离不开合适的工具

weixin_33581873的博客 242

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【仅限首批开放】LLM-Ops监控基线套件(含OpenTelemetry自定义Span Schema + Prometheus指标词典v2.3)

专为AI Agent日志与监控设计的LLM-Ops监控基线套件,开箱即用支持OpenTelemetry自定义Span Schema与Prometheus指标词典v2.3,覆盖推理链路追踪、Token级性能观测与异常检测。适用于生产环境Agent编排系统,提升可观测性与故障定位效率,值得收藏。

SimProceed的博客 172

docker监控部署

Prometheus + cAdvisor + grafana 一、安装前准备: 下载镜像:# https://prometheus.io/docs/prometheus/latest/installation/ 这里使用的本地打包好的镜像包: gunzip -c monitor.tar.gz|docker load docker tag prom/Prometheus 192.168.61.30:5000/prom/prometheus docker tag google/cadvisor 192.1

大眼`不聚光 215

从0开始搭建prometheus监控平台

Prometheus监控平台安装配置 参考资料:https://kuboard.cn/install/install-k8s.html 一、环境准备 1.1 环境说明 名称 版本 下载链接 描述 操作系统 centos7.8 Prometheus prometheus-2.24.0.linux-amd64.tar.gz https://prometheus.io/download/ 普罗米修斯服务 go 1.11.4 https://golang.org/dl/ go环境 G

han949417140的博客 2366

通过Prometheus-Operator实现对k8s集群的监控

特此说明:本篇时基于prometheus-operator官网提供的kube-prometheus原生包进行部署的,由于我的k8s集群为1.18.0版本,考虑到对原生的兼容性,使用的kube-prometheus版本为release-0.6(官网从release-0.5已经开始支持k8s1.18了) 下载kube-prometheus github地址:https://github.com/prometheus-operator/kube-prometheus wget https://github.co

最美dee时光的博客 873

Prometheus架构详解

Prometheus 是一个开源的系统监控报警工具套件,它最初由SoundCloud开发,并于2016年成为CNCF(云原生计算基金会)托管的第二个项目(第一个是kubernetes)。Prometheus 以其简单高效的方式收集指标而闻名,能更好地与容器平台、云平台配合,这使得它在现代云原生环境中非常受欢迎。应用性能监控:监控应用程序的健康状态和性能指标。基础设施监控:监控服务器、存储设备、网络设备等基础设施的状态。业务监控:监控业务层面的关键性能指标(KPIs)。独立性。

pursuit的博客 1429

Prometheus 监控体系:深入理解与应用

Prometheus 是一个开源系统监控和警报工具套件,最初由 SoundCloud 创建,并在 2012 年成为开源项目。自那以后,Prometheus 社区不断壮大,吸引了来自全球的开发者和用户的积极参与。它主要用于收集时间序列数据,并提供了丰富的查询语言和图形界面,使得数据的可视化和分析变得简单易行。除了使用现成的 Exporter 外,Prometheus 还支持通过 HTTP API 自定义监控目标。

cc20100608的专栏 549

Prometheus监控体系分享(2023/供参考)

分享Prometheus相关使用教程

jrivus的博客 890

Scraparr:一款强大的 *arr 套件 Prometheus 导出器

Scraparr:一款强大的 *arr 套件 Prometheus 导出器 项目介绍 Scraparr 是一款针对 *arr 套件(如 Sonarr、Radarr、Lidarr 等)的 Prometheus 导出器。它能够提供详尽的指标数据,使得 Prometheus 能够抓取并监控这些应用的健康状况与性能表现。这款工具适用于那些希望更深入监控和管理自己的 *arr 应用的用户。 项目技术分析 S...

gitblog_00083的博客 1086

Prometheus V2仿真开发套件全新上市,实现一键启动仿真

Prometheus仿真开发套件是阿木实验室为Prometheus仿真以及matlab仿真专门打造的一款小型X86计算主机,预装仿真所需环境及全部资源,搭载Prometheus地⾯站和Prometheus仿真启动器,⽀持到⼿即用,能够帮助开发者快速学习和使⽤Prometheus开源项⽬,提升开发体验和效率。

AMOVLAB(阿木实验室) 1175
上一篇: NetworkManager 与 network 服务深度解析
Heart_reading
博客等级 码龄7年 29粉丝 8原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值