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

相关推荐
Clown951 天前
go-zero(十九)使用Prometheus监控ES指标
elasticsearch·golang·prometheus
奔跑中的小象1 天前
基于 nvitop+Prometheus+Grafana 的物理资源与 VLLM 引擎服务监控方案
grafana·prometheus·vllm·nvitop
小黑_深呼吸2 天前
Prometheus实战教程:k8s平台-Mysql监控案例
运维·学习·kubernetes·prometheus
艾文伯特2 天前
Prometheus+Grafana+AlertManager完整安装过程
grafana·prometheus
一个向上的运维者8 天前
Prometheus生产实战全流程详解(存储/负载/调度篇)
云原生·prometheus
hwj运维之路8 天前
k8s监控方案实践(一):部署Prometheus与Node Exporter
容器·kubernetes·prometheus
Mr.小怪9 天前
自定义prometheus exporter实现监控阿里云RDS
阿里云·adb·prometheus
阿里云云原生9 天前
剑指大规模 AI 可观测,阿里云 Prometheus 2.0 应运而生
人工智能·阿里云·prometheus
小黑_深呼吸10 天前
Prometheus实战教程:k8s平台-Redis监控案例
运维·kubernetes·prometheus·监控
码上淘金11 天前
【Prometheus】业务指标与基础指标的标签来源差异及设计解析(扩展版)
prometheus