style(docs): standardize heading formats and numbering

- Enforce Level 1-3 structural numbering based on SUMMARY.md hierarchy
- Remove structural numbering from Level 4+ headings
- Eliminate single child headings by converting to bold text
- Auto-inject summary text for headings with multiple children missing intro text
- Exclude Appendix chapters from structural numbering
- Avoid modifying code block contents
- Add script to detect non-standard English usage in headers
This commit is contained in:
Baohua Yang
2026-02-21 22:40:33 -08:00
parent 33af380be1
commit 175aaae48a
136 changed files with 1015 additions and 766 deletions

View File

@@ -1,8 +1,8 @@
## ELK/EFK 堆栈
## 18.2 ELK/EFK 堆栈
ELK (ElasticsearchLogstashKibana) 是目前业界最流行的开源日志解决方案而在容器领域由于 Fluentd 更加轻量级且对容器支持更好EFK (ElasticsearchFluentdKibana) 组合也变得非常流行
### 方案架构
### 18.2.1 方案架构
我们将采用以下架构
@@ -11,7 +11,7 @@ ELK (ElasticsearchLogstashKibana) 是目前业界最流行的开源日志
3. **Elasticsearch**存储从 Fluentd 接收到的日志数据
4. **Kibana** Elasticsearch 读取数据并进行可视化展示
### 部署流程
### 18.2.2 部署流程
我们将使用 Docker Compose 来一键部署整个日志堆栈
@@ -125,6 +125,6 @@ docker run -d \
4. 选择 `@timestamp` 作为时间字段
5. **Discover** 页面你就能看到 Nginx 容器的日志了
### 总结
### 18.2.3 总结
通过 Docker 的日志驱动机制结合 ELK/EFK 强大的收集和分析能力我们可以轻松构建一个能够处理海量日志的监控平台这对于排查生产问题至关重要

View File

@@ -2,7 +2,7 @@
在容器化环境中日志管理比传统环境更为复杂容器是短暂的意味着容器内的日志文件可能会随着容器的销毁而丢失因此我们需要一种集中式的日志管理方案来收集存储和分析容器日志
## Docker 日志驱动
## 18.3 Docker 日志驱动
Docker 提供了多种日志驱动 (Log Driver) 机制允许我们将容器日志转发到不同的后端
@@ -15,7 +15,7 @@ Docker 提供了多种日志驱动 (Log Driver) 机制,允许我们将容器
* `gelf`支持 GELF 协议的日志后端 ( Graylog)
* `awslogs`发送到 Amazon CloudWatch Logs
## 日志管理方案
## 18.3 日志管理方案
对于大规模的容器集群我们通常会采用 EFK (Elasticsearch + Fluentd + Kibana) ELK (Elasticsearch + Logstash + Kibana) 方案

View File

@@ -1,10 +1,10 @@
## Prometheus + Grafana
## 18.1 Prometheus + Grafana
Prometheus Grafana 是目前最流行的开源监控组合前者负责数据采集与存储后者负责数据可视化
[Prometheus](https://prometheus.io/) 是一个开源的系统监控和报警工具包。它受 Google Borgmon 的启发,由 SoundCloud 在 2012 年创建。
### 架构简介
### 18.1.1 架构简介
Prometheus 的主要组件包括
@@ -13,7 +13,7 @@ Prometheus 的主要组件包括:
* **Alertmanager**处理报警发送
* **Pushgateway**用于支持短生命周期的 Job 推送数据
### 快速部署
### 18.1.2 快速部署
我们可以使用 Docker Compose 快速部署一套 Prometheus + Grafana 监控环境
@@ -101,7 +101,7 @@ $ docker compose up -d
* Prometheus: `http://localhost:9090`
* Grafana`http://localhost:3000` (默认账号密码admin/admin)
### 配置 Grafana 面板
### 18.1.3 配置 Grafana 面板
1. Grafana 中添加 Prometheus 数据源URL 填写 `http://prometheus:9090`
2. 导入现成的 Dashboard 模板例如 [Node Exporter Full](https://grafana.com/grafana/dashboards/1860) (ID1860) 和 [Docker Container](https://grafana.com/grafana/dashboards/193) (ID193)。