Prometheus二进制安装

系统版本:CentOS 7.9

下载Prometheus

根据平台选择需要的版本,下载地址: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

配置systemd启动

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

标签:端口   防火墙   浏览器   版本   测试   系统   平台

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号

Top