Prometheus二进制安装服务端

1、下载二进制包

wget https://github.com/prometheus/prometheus/releases/download/v2.47.0/prometheus-2.47.0.linux-amd64.tar.gz

2、解压到指定目录

tar xf prometheus-2.47.0.linux-amd64.tar.gz -C /data/prometheus

3、使用systemd托管服务

cat <<-"EOF" > /etc/systemd/system/prometheus.service
[Unit]
Description="prometheus"
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
ExecStart=/data/prometheus/prometheus  --config.file=/data/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheus/data --web.enable-lifecycle

Restart=on-failure
RestartSecs=5s
SuccessExitStatus=0
LimitNOFILE=655360
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=prometheus


[Install]
WantedBy=multi-user.target
EOF

4、启动服务

systemctl daemon-reload
systemctl restart prometheus
systemctl status prometheus

5、检测服务是否启动

[root@k8s-master1 prometheus]# ss -tnlp|grep 9090
LISTEN     0      16384     [::]:9090                  [::]:*                   users:(("prometheus",pid=66464,fd=7))
[root@k8s-master1 prometheus]# 

[root@k8s-master1 prometheus]# netstat -tunlp|grep 9090
tcp6       0      0 :::9090                 :::*                    LISTEN      66464/prometheus    
[root@k8s-master1 prometheus]# 

6、浏览器查看
http://ip:9090
在这里插入图片描述

至此,prometheus部署完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值