Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clinic: add new docs #8226

Merged
merged 109 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
9321329
the-first-two-clinic-doc
qqqdan Jan 25, 2022
e6137ef
add-conent
qqqdan Jan 25, 2022
7f88e07
add-introduce-doc
qqqdan Jan 28, 2022
913f803
add-more-doc
qqqdan Feb 6, 2022
3acd1ab
change-file-name-and-fix-some-issue
qqqdan Feb 8, 2022
f7a3cf6
add-toc
qqqdan Feb 8, 2022
c84fb6b
make-change-based-on-comments
qqqdan Feb 8, 2022
696681e
Update clinic/clinic-introduce.md
qqqdan Feb 8, 2022
7bf524f
Update clinic/clinic-introduce.md
qqqdan Feb 8, 2022
f31dd58
Update clinic/clinic-data-instruction-for-tiup.md
qqqdan Feb 8, 2022
cf72171
Update clinic/clinic-data-instruction-for-tiup.md
qqqdan Feb 8, 2022
1c8b36f
Update clinic/clinic-data-instruction-for-tiup.md
qqqdan Feb 8, 2022
e7e431f
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
c7fc8ba
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
815608a
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
b0030e1
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
ccce481
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
71f4df1
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
7f5531b
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
a81ce79
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 8, 2022
fe5fd84
Update clinic/clinic-data-instruction-for-tiup.md
qqqdan Feb 10, 2022
b6c2035
fix-the-quotes-issues
qqqdan Feb 10, 2022
2271631
fix-all-the-comment
qqqdan Feb 10, 2022
f90fbf4
Update TOC.md
qqqdan Feb 11, 2022
418272f
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
c57d972
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
282bbad
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
5508c43
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
23c3215
Update clinic/clinic-introduce.md
qqqdan Feb 11, 2022
a575d63
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
11b0b7d
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
75f72b4
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
20ad5be
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
a471f49
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
78b13e0
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
176bd23
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
a937570
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
bb1bb68
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
4c70968
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
197aa65
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
3d40eac
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
7ed08f5
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
8428680
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
cf1a067
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
392ddcd
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
6fab81f
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Feb 11, 2022
f79f889
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
09fcc6b
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
e2c3bca
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
5804097
Update clinic/clinic-introduce.md
qqqdan Feb 11, 2022
7933e9d
Update clinic/clinic-introduce.md
qqqdan Feb 11, 2022
82e27eb
Update clinic/clinic-introduce.md
qqqdan Feb 11, 2022
4796134
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
0574ebc
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
533d21b
Update clinic/clinic-data-instruction-for-tiup.md
qqqdan Feb 11, 2022
b03be1d
Update clinic/clinic-data-instruction-for-tiup.md
qqqdan Feb 11, 2022
ecc18f7
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
9ef16ca
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
c29af56
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
cabb18c
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
3da80eb
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
ab81f3c
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
c818b92
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
02fe5f0
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
2a1cdbe
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
f3b3861
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
2bcd195
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
9b429fc
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
f7c09a4
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
1c0c6d4
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
adae501
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
6d7f1d1
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
b988ac0
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
3f7c1f1
Update clinic/Clinic-user-guide-for-Operator.md
qqqdan Feb 11, 2022
7be8ee7
update-based-on-comments
qqqdan Feb 11, 2022
e2aba26
update clinic-user-guide-for-operator.md
en-jin19 Feb 14, 2022
e1c0bb3
Only update the format of clinic-data-instruction-for-operator.md
en-jin19 Feb 14, 2022
7b4c282
only update the format of clinic-data-instruction-for-tiup.md
en-jin19 Feb 14, 2022
5c9a54a
Update clinic/clinic-introduce.md
qiancai Feb 15, 2022
5ccfef1
update a common typo in clinic-data-instruction-for-operator.md
en-jin19 Feb 15, 2022
2570a25
update a common typo
en-jin19 Feb 15, 2022
881fb10
update-based-on-comments
qqqdan Feb 15, 2022
34b9e73
Apply suggestions from code review
qqqdan Feb 16, 2022
004c02f
update-file-name
qqqdan Feb 16, 2022
fd1c1a6
update-link
qqqdan Feb 16, 2022
65af4c1
move two docs to operator repo
en-jin19 Feb 17, 2022
5af082d
update TiUP related contents
en-jin19 Feb 18, 2022
ff800e1
Apply suggestions from code review
en-jin19 Feb 21, 2022
cb59bc7
Apply suggestions from code review
en-jin19 Feb 21, 2022
1fd63a4
Apply suggestions from code review
en-jin19 Feb 21, 2022
623ca91
update
en-jin19 Feb 21, 2022
17156bc
fix CI errors
en-jin19 Feb 21, 2022
12e6291
fix a CI error
en-jin19 Feb 21, 2022
68b1aec
fix dead anchors
en-jin19 Feb 21, 2022
e829cb9
Apply suggestions from code review
en-jin19 Feb 22, 2022
79c4521
Apply suggestions from code review
en-jin19 Feb 23, 2022
3d00c32
Apply suggestions from code review
en-jin19 Feb 23, 2022
444624c
Apply suggestions from code review
en-jin19 Feb 24, 2022
dc9da0a
Apply suggestions from code review
en-jin19 Feb 24, 2022
242bc4a
Apply suggestions from code review
en-jin19 Feb 24, 2022
f8a548d
Apply suggestions from code review
en-jin19 Feb 25, 2022
96dc4ab
update "TiDB Clinic Diagnostic Data"
en-jin19 Mar 2, 2022
622c35b
update "Overview of TiDB Clinic"
en-jin19 Mar 2, 2022
9850200
Update TOC.md
en-jin19 Mar 2, 2022
b48ba7d
update "Use TiDB Clinic"
en-jin19 Mar 2, 2022
26bb1d4
fix jenkins issues
en-jin19 Mar 2, 2022
6a708ad
Update clinic/clinic-introduction.md
qqqdan Mar 3, 2022
7dee451
Update clinic/clinic-user-guide-for-tiup.md
qqqdan Mar 3, 2022
700fa8e
Apply suggestions from code review
en-jin19 Mar 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@
- [tiup-cluster 部署运维生产集群](/tiup/tiup-cluster.md)
- [tiup-mirror 定制离线镜像](/tiup/tiup-mirror.md)
- [tiup-bench 进行 TPCC/TPCH 压力测试](/tiup/tiup-bench.md)
- TiDB Clinic 诊断服务 (Beta)
- [概述](/clinic/clinic-introduction.md)
- [使用 TiDB Clinic](/clinic/clinic-user-guide-for-tiup.md)
- [数据采集说明](/clinic/clinic-data-instruction-for-tiup.md)
- [TiDB Operator](/tidb-operator-overview.md)
- [Dumpling](/dumpling-overview.md)
- TiDB Lightning
Expand Down
140 changes: 140 additions & 0 deletions clinic/clinic-data-instruction-for-tiup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
title: TiDB Clinic 数据采集说明
summary: 详细说明 TiDB Clinic 诊断服务在使用 TiUP 部署的 TiDB 集群和 DM 集群中能够采集哪些诊断数据。
---

# TiDB Clinic 数据采集说明

en-jin19 marked this conversation as resolved.
Show resolved Hide resolved
本文提供了 TiDB Clinic 诊断服务(以下简称为 TiDB Clinic)在使用 TiUP 部署的 TiDB 集群和 DM 集群中能够采集的诊断数据类型,并列出了各个采集项对应的采集参数。当[执行 Clinic Diag 诊断工具(以下简称为 Diag)数据采集命令](/clinic/clinic-user-guide-for-tiup.md)时,你可以依据需要采集的数据类型,在命令中添加所需的采集参数。

通过 TiDB Clinic 在使用 TiUP 部署的集群中采集的数据**仅**用于诊断和分析集群问题。

Clinic Server 是部署在云端的云服务,位于 PingCAP 内网(中国境内)。如果你把采集的数据上传到了 Clinic Server 供 PingCAP 技术人员远程定位集群问题,这些数据将存储于 PingCAP 设立在 AWS S3 中国区(北京)的服务器。PingCAP 对数据访问权限进行了严格的访问控制,只有经授权的内部技术人员可以访问该数据。

在对应的技术支持 Case 关闭后,PingCAP 会在 90 天内对相关数据进行永久删除或匿名化处理。

## TiDB 集群

本节列出了 Diag 在使用 TiUP 部署的 TiDB 集群中能够采集的诊断数据类型。

### Cluster 基础信息

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 集群基础信息,包括集群 ID | `cluster.json` | 每次收集默认采集 |
| 集群详细信息 | `meta.yaml` | 每次收集默认采集 |

### TiDB 诊断数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 日志 | `tidb.log` | `--include=log` |
| Error 日志 | `tidb_stderr.log` | `--include=log` |
| 慢日志| `tidb_slow_query.log` | `--include=log` |
| 配置文件 | `tidb.toml` | `--include=config` |
| 实时配置| `config.json` | `--include=config` |

### TiKV 诊断数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 日志 | `tikv.log` | `--include=log` |
| Error 日志 | `tikv_stderr.log` | `--include=log` |
| 配置文件 | `tikv.toml` | `--include=config` |
| 实时配置 | `config.json` | `--include=config` |

### PD 诊断数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 日志 | `pd.log` | `--include=log` |
| Error 日志 | `pd_stderr.log` | `--include=log` |
| 配置文件 | `pd.toml` | `--include=config` |
| 实时配置 | `config.json` | `--include=config` |
| `tiup ctl pd -u http://${pd IP}:${PORT} store` 的输出结果 | `store.json` | `--include=config` |
| `tiup ctl pd -u http://${pd IP}:${PORT} config placement-rules show` 的输出结果 | `placement-rule.json` | `--include=config` |

### TiFlash 诊断数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 日志 | `tiflash.log` | `--include=log` |
| Error 日志 | `tiflash_stderr.log` | `--include=log` |
| 配置文件 | `tiflash-learner.toml`,`tiflash-preprocessed.toml`,`tiflash.toml` | `--include=config` |
| 实时配置 | `config.json` | `--include=config` |

### TiCDC 诊断数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 日志 | `ticdc.log` | `--include=log`|
| Error 日志 | `ticdc_stderr.log` | `--include=log` |
| 配置文件 | `ticdc.toml` | `--include=config` |

### Prometheus 监控数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 所有的 Metrics 数据 | `{metric_name}.json` | `--include=monitor` |
| Alert 列表 | `alerts.json` | `--include=monitor` |

### TiDB 系统变量

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 获取 TiDB 系统变量(默认不采集,采集需要额外提供数据库帐号) | `mysql.tidb.csv` | `--include=db_vars` |
| | `global_variables.csv` | `--include=db_vars` |

### 集群系统信息

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 内核日志 | `dmesg.log` | `--include=system` |
| 系统和硬件的基础信息 | `insight.json` | `--include=system` |
| 系统 `/etc/security/limits.conf` 中的内容 | `limits.conf` | `--include=system` |
| 内核参数列表 | `sysctl.conf` | `--include=system` |
| socket 统计信息(即 ss 的命令结果) | `ss.txt` | `--include=system` |

## DM 集群

本节列出了 Diag 在使用 TiUP 部署的 DM 集群中能够采集的诊断数据类型。

en-jin19 marked this conversation as resolved.
Show resolved Hide resolved
### Cluster 基础信息

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 集群基础信息,包括集群 ID | `cluster.json`| 每次收集默认采集 |
| 集群详细信息 | `meta.yaml` | 每次收集默认采集 |

### dm-master 诊断数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 日志 | `m-master.log` | `--include=log` |
| Error 日志 | `dm-master_stderr.log` | `--include=log` |
| 配置文件 | `dm-master.toml` | `--include=config` |

### dm-worker 诊断数据
qqqdan marked this conversation as resolved.
Show resolved Hide resolved

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 日志| `dm-worker.log` | `--include=log`|
| Error 日志 | `dm-worker_stderr.log` | `--include=log` |
| 配置文件 | `dm-work.toml` | `--include=config` |

### Prometheus 监控数据

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 所有的 Metrics 数据 | `{metric_name}.json` | `--include=monitor` |
| Alert 列表 | `alerts.json` | `--include=monitor` |

### 集群系统信息

| 诊断数据类型 | 输出文件 | TiDB Clinic 采集参数 |
| :------ | :------ |:-------- |
| 内核日志 | `dmesg.log` | `--include=system` |
| 系统和硬件基础信息 | `insight.json` | `--include=system` |
| 系统 `/etc/security/limits.conf` 中的内容 | `limits.conf` | `--include=system` |
| 内核参数列表 | `sysctl.conf` | `--include=system` |
| socket 统计信息(即 ss 的命令结果) | `ss.txt` | `--include=system` |
61 changes: 61 additions & 0 deletions clinic/clinic-introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: TiDB Clinic 诊断服务简介
summary: 介绍 TiDB Clinic 诊断服务,包括工具组件、使用场景和工作原理。
---

## TiDB Clinic 诊断服务简介

TiDB Clinic 诊断服务(以下简称为 TiDB Clinic)是 PingCAP 为 TiDB 集群提供的诊断服务,支持对使用 TiUP 或 TiDB Operator 部署的集群进行远程定位集群问题和本地快速检查集群状态,用于从全生命周期确保 TiDB 集群稳定运行、预测可出现的集群问题、降低问题出现概率、快速定位并修复问题。

TiDB Clinic 目前处于 Beta 受邀测试使用阶段。该服务提供以下两个组件进行集群诊断:

- Diag:部署在集群侧的工具,用于采集集群的诊断数据 (collect)、上传诊断数据到 Clinic Server、对集群进行本地快速健康检查 (check)。如需了解 Diag 工具可采集的详细的数据列表,请参阅 [TiDB Clinic 数据采集说明](/clinic/clinic-data-instruction-for-tiup.md)。

> **注意:**
>
> - Diag 暂时**不支持**对开启了 TLS 加密的集群和使用 TiDB Ansible 部署的集群进行数据采样。
qqqdan marked this conversation as resolved.
Show resolved Hide resolved
> - TiDB Clinic 目前处于 Beta 受邀测试使用阶段,如需使用 Diag 把数据上传到 Clinic Server,请联系与你对接的 PingCAP 技术人员获取试用账号。

- Clinic Server:部署在云端的云服务。Clinic Server 提供 SaaS 模式的诊断服务,不仅能接收上传到该组件的诊断数据,也可以提供在线诊断环境,用于存储、查看和诊断已上传的诊断数据,并提供集群诊断报告。

> **注意:**
>
> TiDB Clinic Beta 版本的 Server 端功能暂**未开放**给外部用户使用。当你将采集好的数据上传到 Clinic Server 并获取了数据链接后,只有经过授权的 PingCAP 技术支持人员可以访问其链接并查看数据。

## 使用场景

- 远程定位集群问题

当集群出现无法快速修复的问题时,可以求助社区论坛或者联系 PingCAP 技术支持。当申请远程协助时,你需要先保存问题现场的各种诊断数据,然后将其转发给相关技术人员。此时,你可以使用 Clinic Diag 工具,对诊断数据进行一键采集,快速收集完整的诊断数据,替代复杂的手动数据采集操作。随后,你可以将其诊断数据上传到 Clinic Server,供 PingCAP 技术人员查看。Clinic Server 为诊断数据提供了安全的存储,并支持在线诊断,提升了技术人员进行问题定位的效率。

- 本地快速检查集群状态

即使集群可以正常运行,也需要定期检查集群是否有潜在的稳定性风险。TiDB Clinic 提供的本地快速诊断功能,用于检查集群潜在的健康风险。目前 TiDB Clinic Beta 版本主要提供对集群配置项的合理性检查,用于发现不合理的配置,并提供修改建议。

## 工作原理

本章节主要介绍 TiDB Clinic 的集群侧工具 Diag 采集集群诊断数据的工作原理。

首先,Diag 需要从部署工具 TiUP (tiup-cluster) 或 TiDB Operator (tidb-operator) 获取集群拓扑信息,然后通过不同的数据采集方式来采集不同类型的诊断数据,具体采集方式如下:

- 通过 SCP 传输服务器文件

对于使用 TiUP 部署的集群,Diag 可通过 SCP (Secure copy protocol) 直接从目标组件的节点采集日志文件和配置文件。

- 通过 SSH 远程执行命令采集数据

对于 TiUP 部署的集群,Diag 可以通过 SSH (Secure Shell) 连接到目标组件系统,并可执行 Insight 等命令获取系统信息,包括内核日志、内核参数、系统和硬件的基础信息等。

- 通过 HTTP 调用采集数据

- 通过调用 TiDB 组件的 HTTP 接口,Diag 可获取 TiDB、TiKV、PD 等组件的实时配置采样信息与实时性能采样信息。
- 通过调用 Prometheus 的 HTTP 接口,Diag 可获取报警信息和 metrics 监控数据。

- 通过 SQL 语句查询数据库参数

通过 SQL 语句,Diag 可查询 TiDB 数据库的系统参数等信息。对于这种方式,你需要在采集数据时**额外提供**访问 TiDB 数据库的用户名和密码。

## 探索更多

en-jin19 marked this conversation as resolved.
Show resolved Hide resolved
- [使用 TiDB Clinic](/clinic/clinic-user-guide-for-tiup.md)
- [TiDB Clinic 数据采集说明](/clinic/clinic-data-instruction-for-tiup.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [使用 TiDB Clinic](/clinic/clinic-user-guide-for-tiup.md)
- [TiDB Clinic 数据采集说明](/clinic/clinic-data-instruction-for-tiup.md)
- [使用 TiDB Clinic](/clinic/clinic-user-guide-for-tiup.md)
- [TiDB Clinic 数据采集说明](/clinic/clinic-data-instruction-for-tiup.md)

Loading