2023-12-12 16:08:29 +08:00
|
|
|
|
---
|
|
|
|
|
# 部署目录(部署时会在此目录下生成各服务的子目录)
|
|
|
|
|
base_dir: /opt
|
|
|
|
|
|
|
|
|
|
# Docker 配置
|
|
|
|
|
docker:
|
|
|
|
|
## Docker Engine 安装包名称
|
2024-12-19 11:22:00 +00:00
|
|
|
|
package: docker-27.4.1.tgz
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## Docker 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/docker'
|
|
|
|
|
### 可执行文件目录
|
|
|
|
|
bin: '{{ base_dir }}/docker/bin'
|
|
|
|
|
### 数据目录
|
|
|
|
|
data: '{{ base_dir }}/docker/data'
|
|
|
|
|
## 部署 Prometheus 相关组件时使用的网络
|
|
|
|
|
network:
|
|
|
|
|
name: prometheus
|
|
|
|
|
subnet: 10.21.22.0/24
|
|
|
|
|
|
|
|
|
|
# Prometheus Server 配置
|
|
|
|
|
prometheus:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: prom/prometheus:v2.55.1
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/prometheus'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/prometheus/conf'
|
|
|
|
|
### 告警规则文件目录
|
|
|
|
|
rules: '{{ base_dir }}/prometheus/rules'
|
|
|
|
|
### 数据目录
|
|
|
|
|
data: '{{ base_dir }}/prometheus/data'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 9090
|
|
|
|
|
|
|
|
|
|
# Grafana 配置
|
|
|
|
|
grafana:
|
|
|
|
|
## 是否部署 Grafana
|
|
|
|
|
enable: true
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: grafana/grafana:11.4.0
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/grafana'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/grafana/conf'
|
|
|
|
|
### 数据目录
|
|
|
|
|
data: '{{ base_dir }}/grafana/data'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 3000
|
|
|
|
|
|
|
|
|
|
# Alertmanager 配置
|
|
|
|
|
alertmanager:
|
|
|
|
|
## 是否部署 Alertmanager
|
|
|
|
|
enable: true
|
|
|
|
|
## 镜像
|
2024-05-06 15:41:00 +00:00
|
|
|
|
image: prom/alertmanager:v0.27.0
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/alertmanager'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/alertmanager/conf'
|
|
|
|
|
### 模板目录
|
|
|
|
|
template: '{{ base_dir }}/alertmanager/template'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 9093
|
|
|
|
|
|
|
|
|
|
# Prometheus Alert 配置 ( Prometheus Alert 和 Prometheus Webhook Dingtalk 只能开启其中一个,不能同时开启)
|
|
|
|
|
prometheus_alert:
|
|
|
|
|
## 是否启用 Prometheus Alert
|
|
|
|
|
enable: true
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: feiyu563/prometheus-alert:v4.9.1
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/prometheus-alert'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/prometheus-alert/conf'
|
|
|
|
|
### 数据库目录
|
|
|
|
|
db: '{{ base_dir }}/prometheus-alert/db'
|
|
|
|
|
### 数据文件目录
|
|
|
|
|
logs: '{{ base_dir }}/prometheus-alert/logs'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 9080 #8080
|
|
|
|
|
## 用户名
|
|
|
|
|
user: 'admin'
|
|
|
|
|
## 密码
|
|
|
|
|
password: '123456'
|
|
|
|
|
## 标题
|
|
|
|
|
title: 'PrometheusAlert'
|
|
|
|
|
## 访问 URL
|
|
|
|
|
url: 'https://alert.hty1024.com'
|
|
|
|
|
|
|
|
|
|
# Prometheus Webhook Dingtalk 配置 ( Prometheus Alert 和 Prometheus Webhook Dingtalk 只能开启其中一个,不能同时开启)
|
|
|
|
|
prometheus_webhook_dingtalk:
|
|
|
|
|
## 是否启用 Prometheus Webhook Dingtalk
|
|
|
|
|
enable: false
|
|
|
|
|
## 镜像
|
|
|
|
|
image: timonwong/prometheus-webhook-dingtalk:v2.1.0
|
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/prometheus-webhook-dingtalk'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/prometheus-webhook-dingtalk/conf'
|
|
|
|
|
### 模板文件目录
|
|
|
|
|
template: '{{ base_dir }}/prometheus-webhook-dingtalk/template'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 9060 #8060
|
|
|
|
|
|
|
|
|
|
# 告警配置
|
|
|
|
|
alert:
|
|
|
|
|
## 钉钉机器人
|
|
|
|
|
dingtalk:
|
|
|
|
|
access_token: '123456789'
|
|
|
|
|
## 短信
|
|
|
|
|
message:
|
|
|
|
|
type: 'tx'
|
|
|
|
|
phone: '12300001111'
|
|
|
|
|
### 注意:部署完成之后,需要手动将 prometheus-webhook-dingtalk/conf/config.yml 文件的 “【【” 替换为 “{{”,将 “】】” 替换为 “}}”
|
|
|
|
|
title: '【【 template "legacy.title" . 】】'
|
|
|
|
|
text: '【【 template "email.to.message" . 】】'
|
|
|
|
|
|
|
|
|
|
# Loki 配置
|
|
|
|
|
loki:
|
|
|
|
|
## 是否启用 Loki
|
|
|
|
|
enable: true
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: grafana/loki:3.3.2
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/loki'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/loki/conf'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 3100
|
|
|
|
|
|
|
|
|
|
# Node Exporter 配置
|
|
|
|
|
node_exporter:
|
|
|
|
|
## 是否启用 Node Exporter
|
|
|
|
|
enable: true
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: prom/node-exporter:v1.8.2
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/node-exporter'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 9100
|
|
|
|
|
|
|
|
|
|
# CAdvisor 配置
|
|
|
|
|
cadvisor:
|
|
|
|
|
## 是否启用 CAdvisor
|
|
|
|
|
enable: true
|
|
|
|
|
## 镜像
|
|
|
|
|
image: zcube/cadvisor:v0.45.0
|
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/cadvisor'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 9180 #8088
|
|
|
|
|
|
|
|
|
|
# Blackbox Exporter 配置
|
|
|
|
|
blackbox_exporter:
|
|
|
|
|
## 是否启用 Blackbox Exporter
|
|
|
|
|
enable: true
|
|
|
|
|
## 镜像
|
2024-05-06 15:41:00 +00:00
|
|
|
|
image: prom/blackbox-exporter:v0.25.0
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/exporter/blackbox'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/exporter/blackbox/conf'
|
|
|
|
|
## 端口号
|
|
|
|
|
port: 9115
|
|
|
|
|
## 探测 URL
|
|
|
|
|
targets:
|
|
|
|
|
- https://hty1024.com
|
|
|
|
|
- https://www.hty1024.com
|
|
|
|
|
- https://wiki.hty1024.com
|
|
|
|
|
- https://git.hty1024.com
|
|
|
|
|
|
|
|
|
|
# Mysqld Exporter 配置
|
|
|
|
|
mysqld_exporter:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: prom/mysqld-exporter:v0.16.0
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/mysqld-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Mysqld Exporter 端口号
|
|
|
|
|
port: 9104
|
|
|
|
|
### MySQL URL
|
|
|
|
|
url: 127.0.0.1:3306
|
|
|
|
|
### MySQL 用户名
|
|
|
|
|
user: exporter
|
|
|
|
|
### MySQL 密码
|
|
|
|
|
password: 123456
|
|
|
|
|
### MySQL 数据库
|
|
|
|
|
database:
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9104
|
|
|
|
|
url: 192.168.1.1
|
|
|
|
|
user: exporter
|
|
|
|
|
password: 123456
|
|
|
|
|
database:
|
|
|
|
|
|
|
|
|
|
# MongoDB Exporter 配置
|
|
|
|
|
mongodb_exporter:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: bitnami/mongodb-exporter:0.43.1
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/mongodb-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### MongoDB Exporter 端口号
|
|
|
|
|
port: 9126
|
|
|
|
|
### MongoDB URL
|
|
|
|
|
url: 127.0.0.1:27017
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9126
|
|
|
|
|
url: 192.168.1.1:27017
|
|
|
|
|
|
|
|
|
|
# Redis Exporter 配置
|
|
|
|
|
redis_exporter:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: oliver006/redis_exporter:v1.67.0-alpine
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/redis-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Redis Exporter 端口号
|
|
|
|
|
port: 9121
|
|
|
|
|
### Redis URL
|
|
|
|
|
url: 127.0.0.1:6379
|
|
|
|
|
### Redis 密码
|
|
|
|
|
password: 123456
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9121
|
|
|
|
|
url: 127.0.0.1:6379
|
|
|
|
|
password: 123456
|
|
|
|
|
|
|
|
|
|
# Rabbitmq Exporter 配置
|
|
|
|
|
rabbitmq_exporter:
|
|
|
|
|
## 镜像
|
2024-05-06 15:41:00 +00:00
|
|
|
|
image: kbudde/rabbitmq-exporter:1.0.0-RC22
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/rabbitmq-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Rabbitmq Exporter 端口号
|
|
|
|
|
port: 9419
|
|
|
|
|
### RabbitMQ URL
|
|
|
|
|
url: 127.0.0.1:15672
|
|
|
|
|
### RabbitMQ 用户名
|
|
|
|
|
user: root
|
|
|
|
|
### RabbitMQ 密码
|
|
|
|
|
password: 123456
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9419
|
|
|
|
|
url: 127.0.0.1:15672
|
|
|
|
|
user: root
|
|
|
|
|
password: 123456
|
|
|
|
|
|
|
|
|
|
# Rocketmq Exporter 配置
|
|
|
|
|
rocketmq_exporter:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: bitnami/java:1.8.432-7
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## jar 包名称
|
|
|
|
|
jar: rocketmq-exporter-0.0.2-SNAPSHOT.jar
|
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/rocketmq-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Rocketmq Exporter 端口号
|
|
|
|
|
port: 5557
|
|
|
|
|
### Rocketmq URL
|
|
|
|
|
url: 127.0.0.1:9876
|
|
|
|
|
### Rocketmq 版本号
|
|
|
|
|
version: V4_9_4
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 5557
|
|
|
|
|
url: 127.0.0.1:9876
|
|
|
|
|
version: V4_9_4
|
|
|
|
|
|
|
|
|
|
# Elasticsearch Exporter 配置
|
|
|
|
|
elasticsearch_exporter:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: prometheuscommunity/elasticsearch-exporter:v1.8.0
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/elasticsearch-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Elasticsearch Exporter 端口号
|
|
|
|
|
port: 9114
|
|
|
|
|
### Elasticsearch URL
|
|
|
|
|
url: 127.0.0.1:9200
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9114
|
|
|
|
|
url: 127.0.0.1:9200
|
|
|
|
|
|
|
|
|
|
# Zookeeper Exporter 配置
|
|
|
|
|
zookeeper_exporter:
|
|
|
|
|
## 镜像
|
|
|
|
|
image: dabealu/zookeeper-exporter:v0.1.13
|
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/zookeeper-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Zookeeper Exporter 端口号
|
|
|
|
|
port: 9141
|
|
|
|
|
### Zookeeper URL
|
|
|
|
|
url: 127.0.0.1:2181
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9141
|
|
|
|
|
url: 127.0.0.1:2181
|
|
|
|
|
|
|
|
|
|
# JMX Exporter 配置
|
|
|
|
|
jmx_exporter:
|
|
|
|
|
## 运行模式( javaagent:Java Agent 模式运行;httpserver:HTTP Server 模式运行)
|
|
|
|
|
model: httpserver
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: bitnami/java:1.8.432-7
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## jar 包名称
|
|
|
|
|
jar: jmx_prometheus_httpserver-0.17.2.jar
|
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/exporter/jmx-exporter'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/exporter/jmx-exporter/conf'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### JMX Exporter 端口号
|
|
|
|
|
port: 9151
|
|
|
|
|
### JMX Exporter URL
|
|
|
|
|
url: localhost:8080
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9151
|
|
|
|
|
url: localhost:8080
|
|
|
|
|
|
|
|
|
|
# Nginx Prometheus Exporter 配置
|
|
|
|
|
nginx_prometheus_exporter:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: nginx/nginx-prometheus-exporter:1.4.0
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir: '{{ base_dir }}/exporter/nginx-prometheus-exporter'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Nginx Prometheus Exporter 端口号
|
|
|
|
|
port: 9113
|
|
|
|
|
### Nginx URL
|
|
|
|
|
url: http://127.0.0.1/nginx_status
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9113
|
|
|
|
|
url: http://127.0.0.1/nginx_status
|
|
|
|
|
|
|
|
|
|
# Promtail 配置
|
|
|
|
|
promtail:
|
|
|
|
|
## 镜像
|
2024-12-19 11:22:00 +00:00
|
|
|
|
image: grafana/promtail:3.3.2
|
2023-12-12 16:08:29 +08:00
|
|
|
|
## 部署目录
|
|
|
|
|
dir:
|
|
|
|
|
### 主目录
|
|
|
|
|
main: '{{ base_dir }}/exporter/promtail'
|
|
|
|
|
### 配置文件目录
|
|
|
|
|
conf: '{{ base_dir }}/exporter/promtail/conf'
|
|
|
|
|
## 采集节点
|
|
|
|
|
nodes:
|
|
|
|
|
### 主机
|
|
|
|
|
- host: 127.0.0.1
|
|
|
|
|
### Promtail 端口号
|
|
|
|
|
port: 9188
|
|
|
|
|
### 需要收集的日志目录
|
|
|
|
|
targets:
|
|
|
|
|
#### 名称
|
|
|
|
|
- name: system
|
|
|
|
|
#### 路径
|
|
|
|
|
path: /var/log
|
|
|
|
|
- host: 192.168.1.1
|
|
|
|
|
port: 9188
|
|
|
|
|
targets:
|
|
|
|
|
- name: system
|
|
|
|
|
path: /var/log
|
|
|
|
|
|