Skip to content

Commit d6f9507

Browse files
committed
add english doc
1 parent 7cd038b commit d6f9507

File tree

2 files changed

+66
-4
lines changed

2 files changed

+66
-4
lines changed

en/clinic-user-guide.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,74 @@ For clusters deployed using TiDB Operator, Diag is deployed as a standalone Pod.
1919

2020
You can easily collect data from clusters and perform a quick check using the Diag of PingCAP Clinic:
2121

22-
- [Use Diag to collect data](#use-diag-to-collect-data)
22+
- [Use Diag to collect diagnostic data](#use-diag-to-collect-data)
2323
- [Use Diag to perform a quick check on the cluster](#use-diag-to-perform-a-quick-check-on-the-cluster)
2424

25-
## Install Diag client
25+
For TiDB clusters deployed using TiDB Operator, Diag can run in two modes: command line mode that can run anywhere and server mode deployed to k8s. Command line mode is simpler to use and can collect some logs.
2626

27-
The following sections describe how to install Diag.
27+
## Use Diag CLI
28+
29+
Diag CLI can run anywhere that can connect to the k8s where the TiDB cluster is located. It can be a pod with permissions in the cluster or a developer's laptop.
30+
31+
### Step 1: Install TiUP
32+
33+
Run `tiup --version` to check if TiUP is already installed. If TiUP is already installed, skip this step. If TiUP is not installed, run the following command:
34+
35+
```
36+
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
37+
```
38+
39+
### Step 2: Install Diag
40+
41+
```shell
42+
tiup install diag
43+
```
44+
45+
### Step 3: Run Diag
46+
47+
1. Run Diag to collect diagnostic data.
48+
49+
For example, to collect diagnostic data from 4 hours ago to 2 hours ago from the current time, you can run the following command:
50+
51+
```bash
52+
tiup diag collectk ${cluster-name} -f="-4h" -t="-2h" --kubeconfig /path/to/config --namespace xxx --monitor-namespace xxx
53+
```
54+
55+
If running inside a k8s cluster, use the following command and ensure the pod has the necessary permissions:
56+
57+
```bash
58+
tiup diag collectk ${cluster-name} -f="-4h" -t="-2h" --direct --namespace xxx --monitor-namespace xxx
59+
```
60+
61+
After running the Diag data collection command, Diag will not immediately start collecting data. Instead, it will provide an estimated data size and storage path in the output and ask if you want to proceed with data collection. If you confirm to start collecting data, enter `Y`.
62+
63+
After collection is complete, Diag will prompt with the folder path where the collected data is stored.
64+
65+
2. Upload the collected data to Clinic Server.
66+
67+
> **Note:**
68+
>
69+
> The size of uploaded data (compressed folder file) must not exceed 3 GB, otherwise the upload will fail.
70+
71+
- If your cluster network can access the Internet, you can upload the collected data package folder using the following command:
72+
73+
```bash
74+
tiup diag upload ${filepath}
75+
```
76+
77+
After the upload is complete, Diag will provide the diagnostic data download URL.
78+
79+
- If your cluster cannot access the Internet, you need to package the data first and then upload it. For specific steps, refer to [Upload Method 2: Package and Upload](https://docs.pingcap.com/tidb/stable/clinic-user-guide-for-tiup/#method-2-pack-and-upload-data).
80+
81+
3. After completing the data upload, get the diagnostic data link through the `Download URL` in the upload output.
82+
83+
The diagnostic data includes cluster name, cluster topology information, log content in the diagnostic data package, and Grafana Dashboard information rebuilt based on metrics information in the diagnostic data package.
84+
85+
You can use this data to find and diagnose cluster problems yourself, or you can send the link to PingCAP technical support staff to assist with remote troubleshooting of cluster issues.
86+
87+
## Install Diag Server
88+
89+
This section provides detailed instructions for installing Diag.
2890

2991
### Step 1: Prepare the environment
3092

zh/clinic-user-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Diag 命令行可以在任何可以连接到 TiDB 集群所在 k8s 的地方运
7474

7575
完成上传后,Diag 会提示诊断数据的下载路径 `Download URL`
7676

77-
- 如果你所在的集群无法访问互联网,需要先打包数据后进行上传。具体步骤,请参阅[上传方式 2:打包后上传](/clinic/clinic-user-guide-for-tiup.md#方式-2打包后上传)。
77+
- 如果你所在的集群无法访问互联网,需要先打包数据后进行上传。具体步骤,请参阅[上传方式 2:打包后上传](https://docs.pingcap.com/zh/tidb/stable/clinic-user-guide-for-tiup/#方式-2打包后上传)。
7878

7979
3. 完成数据上传后,通过上传输出结果中的 `Download URL` 获取诊断数据的链接。
8080

0 commit comments

Comments
 (0)