安装包下载
代码语言:javascript复制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 pushgatewayCopy
修改配置文件
代码语言:javascript复制mkdir /data/prometheus/data
vim /data/prometheus/prometheus.yml
新增:
- job_name: 'pushgateway'
static_configs:
- targets: ['localhost:9091']
labels:
instance: pushgatewayCopy
启动prometheus
代码语言:javascript复制nohup /data/prometheus/prometheus --config.file=/data/prometheus/prometheus.yml
--storage.tsdb.path=/data/prometheus/data > /data/prometheus/prometheus.log 2>&1 &Copy
启动pushgateway
代码语言:javascript复制nohup /data/pushgateway/pushgateway > /data/pushgateway/pushgateway.log 2>&1 &Copy
prometheus与pushgateway停止
代码语言:javascript复制ps -ef | grep prometheus
ps -ef | grep pushgatewayCopy
通过以上方法找出相关进行,然后通过kill命名进行停止。
本文为从大数据到人工智能博主「xiaozhch5」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://cloud.tencent.com/developer/article/1936350