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

posted @ 2022-05-16 17:34  MAUI程序员  阅读(137)  评论(0)    收藏  举报