1. 程式人生 > 其它 >Prometheus&Grafana 的安裝

Prometheus&Grafana 的安裝

Prometheus&Grafana 下載地址:https://pan.baidu.com/s/1KYdt-8STrjfFH7ebBoSXzg   提取碼 3v3d 1.上傳到 /opt/software 1.1  安裝 Prometheus
[atguigu@hadoop1 software]$ tar -zxvf prometheus-2.35.0.linux-amd64.tar.gz -C /opt/module
修改目錄名
[atguigu@hadoop1 ~] cd /opt/module
[atguigu@hadoop1 module] mv prometheus-2.35.0.linux-amd64 prometheus-2.35.0
修改配置檔案 prometheus.yml

scrape_configs:

- job_name: 'prometheus'
static_configs:
- targets: ['hadoop1:9090']
#新增 ClickHouse 監控配置
- job_name: clickhouse-1
static_configs:
- targets: ['hadoop1:9363']

  啟動 Prometheus Server
[atguigu@hadoop1 prometheus-2.35.0]$  ./prometheus --config.file=prometheus.yml
http://hadoop1:9090/

2.Grafana 安裝
[atguigu@hadoop1 software]$ tar -zxvf grafana-7.5.2.linux-amd64.tar.gz -C /opt/module/
[atguigu@hadoop1 module]$ mv grafana-7.5.2.linux-amd64 grafana-7.5.2
[atguigu@hadoop1 grafana-7.5.2]$ ./bin/grafana-server web 

開啟 web:http://hadoop1:3000,預設使用者名稱和密碼:admin

3.開啟clickhouse監控
編輯/etc/clickhouse-server/config.xml,開啟如下配置:

<prometheus>
<endpoint>/metrics</endpoint>
<port>9363</port>
<metrics>true</metrics>
<events>true</events>
<asynchronous_metrics>true</asynchronous_metrics>
<status_info>true</status_info>
</prometheus>

重啟clickhouse

sudo clickhouse restart

訪問:http://hadoop1:9363/metrics