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

相关推荐
大咖分享课6 小时前
云原生监控体系建设:Prometheus+Grafana的企业级实践
云原生·grafana·prometheus
欧先生^_^1 天前
ingress-nginx 开启 Prometheus 监控 + Grafana 查看指标
nginx·grafana·prometheus
XMYX-02 天前
Spring Boot + Prometheus 实现应用监控(基于 Actuator 和 Micrometer)
spring boot·后端·prometheus
时间裂缝里的猫-O-4 天前
@Prometheus 监控-MySQL (Mysqld Exporter)
数据库·mysql·prometheus
qq_312920116 天前
K8S上使用helm部署 Prometheus + Grafana
kubernetes·grafana·prometheus
MyikJ7 天前
Java 面试实录:从Spring到微服务的技术探讨
java·spring boot·微服务·kafka·spring security·grafana·prometheus
怡人蝶梦7 天前
Java大厂后端技术栈故障排查实战:Spring Boot、Redis、Kafka、JVM典型问题与解决方案
java·jvm·redis·elk·kafka·springboot·prometheus
tatasix7 天前
从监控到告警:Prometheus+Grafana+Alertmanager+告警通知服务全链路落地实践
grafana·prometheus
时间裂缝里的猫-O-7 天前
@Docker Compose部署Alertmanager
docker·容器·eureka·prometheus
怡人蝶梦8 天前
Java后端技术栈问题排查实战:Spring Boot启动慢、Redis缓存击穿与Kafka消费堆积
java·jvm·redis·kafka·springboot·prometheus