prometheus linux下载_Prometheus(1) - 安装

下载地址:https://prometheus.io/download/

这里以prometheus-2.15.2.linux-amd64.tar.gz为例

下载到 /home/用户名/prometheus-2.15.2.linux-amd64.tar.gz

// 解压缩# tar -xzvf prometheus-2.15.2.linux-amd64.tar.gz# mkdir /usr/local/prometheus# mv prometheus-2.15.2.linux-amd64 /usr/local/prometheus/prometheus// 查看版本# ./prometheus --version
// 创建本地存储目录(tsdb时序数据库)# mkdir -p /usr/local/prometheus/data
// 添加用户和用户组,用此账号启动prometheus服务# groupadd prometheus# useradd -g prometheus -s /sbin/nologin prometheus// 赋权# chown -R prometheus:prometheus /usr/local/prometheus/prometheus# chown -R prometheus:prometheus /usr/local/prometheus/data// 添加启动服务# vim /usr/lib/systemd/system/prometheus.service[Unit]Description= PrometheusAfter=network.target# Type设置为notify时,服务会不断重启# User设置对应上面创建的账号# 存储配置, # By default, Prometheus stores its database in ./data (flag --storage.tsdb.path).# --storage.tsdb.path: 存储数据的目录,默认为./data# --storage.tsdb.retention.time: 数据过期清理时间,默认保存15天[Service]Type=simpleUser=prometheusExecStart=/usr/local/prometheus/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus/prometheus.yml --storage.tsdb.path=/usr/local/prometheus/dataExecReload=/bin/kill -HUP $MAINPIDRestart=on-failure[Install]WantedBy=multi-user.target
// 自动重启服务# systemctl enable prometheus.service// 启动服务# systemctl start prometheus.service// 查看服务状态# systemctl status prometheus.service
// 浏览器查看服务状态http://服务器ip:9090
184afc0f72654621bbcf33ad687b520d
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值