Prometheus + ClickHouse Exporter + Grafana 实现ClickHouse监控

部署运行你感兴趣的模型镜像

(一) Prometheus

参考:
https://prometheus.io/docs/introduction/first_steps/
https://prometheus.io/docs/prometheus/latest/installation/
https://blog.youkuaiyun.com/luanpeng825485697/article/details/82318204

(1) 安装(下面介绍使用Docker进行安装)
Docker 拉取镜像

docker pull prom/prometheus

(2)配置文件:prometheus.yml

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']

  - job_name: 'clickhouse_exporter'

    # 覆盖全局的 scrape_interval
    scrape_interval: 5s

    static_configs:
    - targets: ['192.168.10.154:9116']

(3)docker 运行

sudo docker run -d -p 9090:9090 -v $PWD/prometheus-data/prometheus.yml:/etc/prometheus/prometheus.yml -v $PWD/prometheus-data:/prometheus --user "root" --name prometheus prom/prometheus

(4)测试验证
在浏览器输入下面url能访问到内容,则表明测试成功。

# localhost填写prometheus安装的服务ip地址
http://localhost:9090/

(二)ClickHouse Exporter

参考:https://github.com/f1yegor/clickhouse_exporter

推荐使用Docker进行安装:

  1. Docker 拉取镜像
docker pull f1yegor/clickhouse-exporter
  1. Docker 运行
# clickhouse.service.consul 填写clickhouse安装的服务ip地址
docker run -d -p 9116:9116 f1yegor/clickhouse-exporter -scrape_uri=http://clickhouse.service.consul:8123/
  1. 测试验证
    在浏览器输入下面url能访问到内容,则表明测试成功。
# localhost填写clickhouse-exporter安装的服务ip地址
http://localhost:9116/

(三)Grafana

安装参考:https://grafana.com/grafana/download

  1. Centos (64 Bit) 安装
sudo wget https://dl.grafana.com/oss/release/grafana-6.0.2-1.x86_64.rpm 
sudo yum localinstall grafana-6.0.2-1.x86_64.rpm 
  1. 配置文件,可以根据自己需求修改
sudo vim /etc/grafana/grafana.ini

[server]
;protocol = http (默认的连接形式)
;http_addr = (这里可以限制登陆的ip,增加安装性)
;http_port = 3000 (端口)
;domain = localhost (域名)
;enforce_domain = false
;root_url = http://localhost:3000 (访问的项目地址)

  1. 运行
# 开启grafana
sudo systemctl start grafana-server
# 设为开机启动
sudo systemctl enable grafana-server

默认情况下,Grafana将监听 http://localhost:3000。默认登录名和密码都为"admin",第一次登录会提示修改。

(四) 通过上面步骤的安装运行完成之后,可以在浏览器通过http://localhost:3000进行对应监控数据的显示面板配置。

参考:https://grafana.com/dashboards/882

您可能感兴趣的与本文相关的镜像

ACE-Step

ACE-Step

音乐合成
ACE-Step

ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值