prometheus设置为服务后启动时总是失败

一、问题描述

        在我们下载完成prometheus程序包,使用二进制的prometheus测试启动正常,但是将prometheus程序设置为服务开机自启时,该prometheus服务并没有启动,并且手动设置启动该服务也是失败提示【Failed to start "prometheus".】,如下图所示:

二、问题分析

通过分析问题可知:

①prometheus程序的配置文件【prometheus.yml】没有问题(因为可以直接使用二进制的prometheus文件正常启动);

#下载prometheus的linux安装包
wget https://github.com/prometheus/prometheus/releases/download/v2.37.6/prometheus-2.37.6.linux-amd64.tar.gz

#解压prometheus安装包
tar xf prometheus-2.37.6.linux-amd64.tar.gz

#查看当前prometheus版本命令
./prometheus --version

#启动二进制prometheus文件命令
./prometheus &
#将prometheus设置为服务且开机自启

cat <<EOF >/etc/systemd/system/prometheus.service
[Unit]
Description="prometheus"
Documentation=https://promet

猜你喜欢

转载自blog.csdn.net/xiaochenXIHUA/article/details/129805986
今日推荐