【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 服务发现 添加标签
服务发现·prometheus
陈小肚7 天前
运维别卷系列 - 云原生监控平台 之 03.prometheus label 实践
运维·云原生·prometheus
陈小肚7 天前
运维别卷系列 - 云原生监控平台 之 05.prometheus alertManager 实践
运维·云原生·prometheus
袁随8 天前
安装配置pushgateway
linux·运维·服务器·docker·prometheus
咕咕咕daisy!9 天前
k8s部署最新版zookeeper集群(3.9.2),并配置prometheus监控
zookeeper·kubernetes·prometheus
盛者无名10 天前
k8s部署针对外部服务器的prometheus服务
服务器·kubernetes·prometheus
明明跟你说过11 天前
在k8s中安装Grafana并对接Prometheus,实现k8s集群监控数据的展示
linux·运维·kubernetes·k8s·grafana·prometheus
明明跟你说过11 天前
在k8s中部署Prometheus并实现对k8s集群的监控
运维·docker·云原生·容器·kubernetes·prometheus
codebat_raymond12 天前
Prometheus 2: 一个专门评估其他语言模型的开源语言模型(续集)
语言模型·开源·prometheus
开着拖拉机回家13 天前
【prometheus】Pushgateway安装和使用
prometheus·监控·pushdateway·指标拉取·指标推送