创建软连接:
[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.
浙公网安备 33010602011771号