promethues安装

prometheus

1. 下载安装

  • 下载安装:https://github.com/prometheus/prometheus/releases/tag/v2.9.2
wget https://github.com/prometheus/prometheus/releases/download/v2.9.2/prometheus-2.9.2.linux-amd64.tar.gz
tar -xvzf prometheus-2.9.2.linux-amd64.tar.gz
cd prometheus-2.9.2.linux-amd64
  • 修改prometheus.yml(如果有自己实现的api)
vim prometheus.yml

#在最后加入如下配置
  - job_name: 'metrics_test'
    scrape_interval:     3s
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['192.168.163.1:22222']

promethues安装_第1张图片

2. 启动

#直接启动
./prometheus --config.file="prometheus.yml"
#后台启动
nohup ./prometheus --config.file="prometheus.yml" >/dev/null 2>&1 &

打开浏览器,输入IP+端口,9090为prometheus的默认侦听端口。

你可能感兴趣的:(promethues安装)