Li Jinli
不必因昨天的眼泪、湿了今天的太阳。

 创建软连接:

[root@promethues ~]# ln -s /usr/local/prometheus-2.23.0.linux-amd64/ /usr/local/prometheus

将promethues配置文件复制到etc目录下

[root@promethues prometheus]# cp prometheus.yml  /etc/

新建文件prometheus.service并写入以下内容

[root@prometheus bin]#  vi /usr/lib/systemd/system/prometheus.service
[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System

[Service]
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --web.li
sten-address=:9090

[Install]
WantedBy=multi-user.target

[root@promethues ~]# systemctl daemon-reload

[root@promethues ~]# systemctl start prometheus
[root@promethues ~]# systemctl enable prometheus
Created symlink from /etc/systemd/system/multi-user.target.wants/prometheus.service to /usr/lib/systemd/system/prometheus.service.

posted on 2021-09-10 11:37  lijinli  阅读(587)  评论(0)    收藏  举报