我正在使用下面的教程url,我是普罗米修斯的新手。
错误如下:启动prometheus.service失败:单元prometheus.service有错误的单元文件设置.
追踪情况如下:
systemctl status prometheus.service
○ prometheus.service - Prometheus Server
Loaded: bad-setting (Reason: Unit prometheus.service has a bad unit file setting.)
Active: inactive (dead)
Docs: https://prometheus.io/docs/introduction/overview/
Sep 26 02:17:00 fedora systemd[1]: /etc/systemd/system/prometheus.service:13: Neither a valid executable name nor an absolute path: ~/prometheus/prometheus
Sep 26 02:17:00 fedora systemd[1]: prometheus.service: Unit configuration has fatal error, unit will not be started.
Sep 26 02:19:00 fedora systemd[1]: /etc/systemd/system/prometheus.service:13: Neither a valid executable name nor an absolute path: ~/prometheus/prometheus
Sep 26 02:19:00 fedora systemd[1]: prometheus.service: Unit configuration has fatal error, unit will not be started.
Sep 26 02:20:34 fedora systemd[1]: /etc/systemd/system/prometheus.service:13: Neither a valid executable name nor an absolute path: ~/prometheus/prometheus
Sep 26 02:20:34 fedora systemd[1]: prometheus.service: Unit configuration has fatal error, unit will not be started.
Sep 26 02:23:48 fedora systemd[1]: /etc/systemd/system/prometheus.service:13: Neither a valid executable name nor an absolute path: ~/prometheus/prometheus
Sep 26 02:23:48 fedora systemd[1]: prometheus.service: Unit configuration has fatal error, unit will not be started.prometheus.service文件如下:
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network-online.target
[Service]
User=root
Restart=on-failure
#Change this line if you download the
#Prometheus on different path user
ExecStart=~/prometheus/prometheus --storage.tsdb.path=/var/lib/prometheus/data/ --web.external-url=http://myurl.com:9090
[Install]
WantedBy=multi-user.target发布于 2021-09-26 17:57:01
您需要在prometheus.service文件中使用绝对路径:
ExecStart=/xxx/yyy/zzz/prometheus/prometheus ...https://stackoverflow.com/questions/69333113
复制相似问题