【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博客

相关推荐
Insist7534 小时前
prometheus安装部署与alertmanager邮箱告警
linux·运维·grafana·prometheus
小阳睡不醒14 小时前
小白成长之路-部署prometheus监控平台
prometheus
运维成长记4 天前
云原生监控系统 Prometheus大总结 20250909
云原生·prometheus
_何同学5 天前
Spring Boot 监控实战:集成 Prometheus 与 Grafana,打造全方位监控体系
spring boot·grafana·prometheus
g66x7 天前
自建prometheus监控腾讯云k8s集群
kubernetes·腾讯云·prometheus
苦逼IT运维7 天前
Jenkins 监控方案:Prometheus + Grafana 实践
jenkins·grafana·prometheus
迦蓝叶9 天前
JAiRouter 配置文件重构纪实 ——基于单一职责原则的模块化拆分与内聚性提升
java·网关·ai·重构·openai·prometheus·单一职责原则
会飞的小蛮猪9 天前
Jenkins运维之路(权限分配&忘记admin密码)
java·运维·经验分享·jenkins·prometheus
川石课堂软件测试10 天前
Oracle 数据库:视图与索引
数据库·网络协议·nginx·http·oracle·grafana·prometheus
川石课堂软件测试10 天前
Oracle 数据库如何查询列
linux·数据库·sql·功能测试·oracle·grafana·prometheus