系统版本:CentOS 7.9
根据平台选择需要的版本,下载地址:https://github.com/prometheus/prometheus/releases
wget https://github.com/prometheus/prometheus/releases/download/v2.44.0/prometheus-2.44.0.linux-amd64.tar.gz
tar zxvf prometheus-2.44.0.linux-amd64.tar.gz -C /usr/local/
cd /usr/local/
mv prometheus-2.44.0.linux-amd64 prometheus
vim /lib/systemd/system/prometheus.service
[Unit]
Description="Prometheus"
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
WorkingDirectory=/usr/local/prometheus
ExecStart=/usr/local/prometheus/prometheus --config.file=prometheus.yml --web.enable-lifecycle --enable-feature=remote-write-receiver
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
systemctl daemon-reload # 重载systemd配置文件
启动prometheus服务,并设置开机自启
systemctl start prometheus.service
systemctl start prometheus.service
如果想实现服务外部访问,需关闭防火墙或者放行9090端口
firewall-cmd --permanent --add-port=9090/tcp
firewall-cmd --reload
测试:浏览器访问 http://ip:9090 进行测试。
页面更新:2024-04-30
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号