首页 > 技术文章 > 二进制安装prometheus主控

faberbeta 2020-08-25 14:17 原文

推荐二进制安装prometheus

#!/bin/bash
cd /usr/local/src
wget -O prometheus-2.20.1.linux-amd64.tar.gz https://github.com/prometheus/prometheus/releases/download/v2.20.1/prometheus-2.20.1.linux-amd64.tar.gz || wget -O prometheus-2.20.1.linux-amd64.tar.gz http://download.zhufunin.com/prometheus/prometheus-2.20.1.linux-amd64.tar.gz

tar zxf  prometheus-2.20.1.linux-amd64.tar.gz
test -d /usr/local/prometheus || mv prometheus-2.20.1.linux-amd64 /usr/local/prometheus

mkdir -p /prometheus/data

wget -O /usr/lib/systemd/system/prometheus.service http://download.zhufunin.com/prometheus/prometheus.service
systemctl daemon-reload
systemctl enable prometheus
systemctl start prometheus

手动启动的方式

/usr/local/prometheus/prometheus\
        --config.file=/usr/local/prometheus/prometheus.yml\
        --storage.tsdb.path=/prometheus/data/ 

推荐阅读