1、下载安装包
https://prometheus.io/download/
2、解压安装包
tar -xvf prometheus-2.37.4.linux-amd64.tar.gz
3、做软连接,指定自己的解压的目录
ln -sv /root/prometheus/prometheus-2.37.4.linux-amd64 /usr/local/prometheus
4、配置启动脚本
vim /usr/lib/systemd/system/prometheus.service
[Unit]
Description=Prometheus
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target
5、启动prometheus,并且配置开启自启动
systemctl daemon-reload
systemctl start prometheus.service
systemctl enable prometheus.service
标签:tar,service,安装,prometheus,systemctl,usr,local From: https://www.cnblogs.com/mxdboke/p/16953878.html