【Mac】mac 安装 prometheus 报错 prometheus: prometheus: cannot execute binary file

1、官网下载

Download | Prometheus

这里下载的是prometheus-2.51.2.linux-amd64.tar.gz

2、现象

解压之后启动Prometheus

启动脚本:

复制代码
nohup ./prometheus --config.file=prometheus.yml > prometheus.out 2>&1 &

prometheus.out日志文件:

3、分析

cannot execute binary file通常意味着尝试执行的二进制文件(在这种情况下是 prometheus)与系统架构或操作系统不兼容。

从以下几个方面进行自查:

检查文件权限

使用 chmod 命令确保文件具有执行权限:

复制代码
chmod +x ./prometheus

检查文件类型

使用 file 命令来检查文件类型,确认它是一个 ELF 可执行文件:

复制代码
file ./prometheus

检查系统架构

使用 uname -m 命令来检查你的系统架构,并确认你下载的 Prometheus 二进制文件与你的系统架构相匹配。

复制代码
uname -m

系统是 x86_64 架构,确保你下载了适用于该架构的 Prometheus 二进制文件。

4、解决方案

编译环境是否相同?

mac的内核是darwin,linux的版本不匹配。重新下载,启动成功!

下载prometheus-2.51.2.darwin-amd64.tar.gz

参考:【Mac】mac 安装 prometheus 报错 prometheus: prometheus: cannot execute binary file_./prometheus: cannot execute binary file-CSDN博客

相关推荐
2601_9620973612 小时前
可观测性实战:Prometheus+Grafana+OTel构建监控
grafana·prometheus·微服务架构·可观测性·opentelemetry
IT界的老黄牛1 天前
Jenkins 监控一条龙:接入、看板 9964、11 条告警规则直接抄走
jenkins·grafana·prometheus·监控·ci-cd·告警规则
陈皮糖..1 天前
基于 Keepalived 的传统 Web 高可用架构的容器化改造与可观测性升级
运维·docker·性能优化·架构·云计算·prometheus
heimeiyingwang2 天前
【Prometheus·部署篇】存储与容量规划:本地存储、远程存储与长期保存
prometheus
heimeiyingwang2 天前
【Prometheus·可视化篇】Grafana 集成:数据源配置与 Dashboard 设计原则
grafana·prometheus
IT界的老黄牛2 天前
Jenkins 构建卡了 23 天,abort 按钮点了没用
jenkins·maven·prometheus·告警·排查·ci-cd
heimeiyingwang4 天前
【Prometheus·告警篇】告警规则:Recording Rules 与 Alerting Rules 最佳实践
prometheus
AAA@峥5 天前
从零搭建 Prometheus 完整监控告警体系|Linux 部署 + node_exporter+Grafana 可视化
云原生·grafana·prometheus
liuyicenysabel6 天前
Grafana + Prometheus 分级告警配置设计(P0/P1/P2)
javascript·grafana·prometheus
随遇而安zx6 天前
SpringCloud---可观测性与监控:Actuator / Micrometer / Prometheus / Grafana 深度解析
spring cloud·grafana·prometheus