安装包下载
mkdir /data && cd /data
wget https://github.com/prometheus/prometheus/releases/download/v2.30.0/prometheus-2.30.0.linux-amd64.tar.gz
tar zxvf prometheus-2.30.0.linux-amd64.tar.gz
ln -s prometheus-2.30.0.linux-amd64 prometheus
wget https://github.com/prometheus/pushgateway/releases/download/v1.4.1/pushgateway-1.4.1.linux-amd64.tar.gz
tar zxvf pushgateway-1.4.1.linux-amd64.tar.gz
ln -s pushgateway-1.4.1.linux-amd64 pushgateway
修改配置文件
mkdir /data/prometheus/data
vim /data/prometheus/prometheus.yml
新增:
- job_name: 'pushgateway'
static_configs:
- targets: ['localhost:9091']
labels:
instance: pushgateway
启动prometheus
nohup /data/prometheus/prometheus --config.file=/data/prometheus/prometheus.yml \
--storage.tsdb.path=/data/prometheus/data > /data/prometheus/prometheus.log 2>&1 &
启动pushgateway
nohup /data/pushgateway/pushgateway > /data/pushgateway/pushgateway.log 2>&1 &
prometheus与pushgateway停止
ps -ef | grep prometheus
ps -ef | grep pushgateway
通过以上方法找出相关进行,然后通过kill命名进行停止。
本文为从大数据到人工智能博主「xiaozhch5」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://lrting.top/useful-tools/2140/
[…] Prometheus与pushGateway安装与使用 […]