-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add more Dashboard docs #3440
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
Merged
Merged
Add more Dashboard docs #3440
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ef3cf31
Add more Dashboard docs
breezewish efcf816
Modify titles
breezewish e34cff9
Add note for old tiup cluster
breezewish a00e19f
Fix deadlink
breezewish ca1e017
Remove KeyViz default disabled notice since it defaults to enabled.
breezewish 893d70e
Fix mistakes in slow query screenshoots
breezewish 89607b4
dashboard, toc: update wording and format
lilin90 a1e8cfd
Update a link
lilin90 5ff7282
Apply suggestions from code review
breezewish 6a8d88a
Add some notes for restart TiDB Dashboard
breezewish 4b3f0b2
Update screenshot
breezewish 85d5565
Update some words
breezewish a1eb468
Merge branch 'master' into more-dashboard-doc
breezewish 5fa353b
Add missing yaml
breezewish 100a71b
Update dashboard/dashboard-statement-details.md
breezewish 741cfba
Update image
breezewish 6aed51f
Merge branch 'master' into more-dashboard-doc
sre-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| title: TiDB Dashboard 常见问题 | ||
| category: how-to | ||
| --- | ||
|
|
||
| # TiDB Dashboard 常见问题 | ||
|
|
||
| 本文汇总了使用 TiDB Dashboard 过程中的常见问题与解决办法。 | ||
|
|
||
| ## 访问 | ||
|
|
||
| ### 已配置防火墙或反向代理,但访问后被跳转到一个内部地址无法访问 TiDB Dashboard | ||
|
|
||
| 集群部署有多个 PD 实例的情况下,只有其中某一个 PD 实例会真正运行 TiDB Dashbaord 服务,访问其他 PD 实例时会发生浏览器端重定向。若防火墙或反向代理没有为此进行正确配置,就可能出现访问后被重定向到一个被防火墙或反向代理保护的内部地址的情况。 | ||
|
|
||
| - 参阅 [TiDB Dashboard 多 PD 实例部署](/dashboard/dashboard-ops-deploy.md#多-PD-实例部署)章节了解多 PD 实例下 TiDB Dashboard 的工作原理。 | ||
| - 参阅[通过反向代理使用 TiDB Dashboard](/dashboard/dashboard-ops-reverse-proxy.md) 章节了解如何正确配置反向代理。 | ||
| - 参阅[提高 TiDB Dashboard 安全性](/dashboard/dashboard-ops-security.md)章节了解如何正确配置防火墙。 | ||
|
|
||
| ### 双网卡部署时无法通过另一个网卡访问 TiDB Dashboard | ||
|
|
||
| PD 中的 TiDB Dashboard 出于安全考虑仅监听部署时所指定的 IP 地址(即只监听在一个网卡上),而非 `0.0.0.0`,因此当主机上安装了多个网卡时,通过另一个网卡将无法访问。 | ||
|
|
||
| 当你使用 `tiup cluster` 或 `tiup playground` 命令部署时,目前尚没有方法改变该行为。推荐使用反向代理将 TiDB Dashboard 安全地暴露给另一个网卡,具体参见[通过反向代理使用 TiDB Dashboard](/dashboard/dashboard-ops-reverse-proxy.md) 章节。 | ||
|
|
||
| ## 界面功能 | ||
|
|
||
| ### 概况页面中 QPS 及 Latency 显示 `prometheus_not_found` 错误 | ||
|
|
||
| QPS 及 Latency 监控依赖于集群中已正常部署 Prometheus 监控实例,没有部署的情况下就会显示为错误。向集群中新部署 Prometheus 实例即可解决该问题。 | ||
|
|
||
| 若已经部署 Prometheus 监控实例但仍然显示为错误,可能的原因是您使用的部署工具(TiUP、tidb-operator 或 TiDB Ansible)版本比较旧,没有自动汇报监控地址,导致 TiDB Dashboard 无法感知并查询监控数据。可以升级到最新的部署工具并重试。 | ||
|
|
||
| 以下给出 TiUP 部署工具的操作方法,对于其他部署工具,请参阅工具对应文档。 | ||
|
|
||
| 1. 升级 TiUP、TiUP Cluster: | ||
|
|
||
| ```bash | ||
| tiup update --self | ||
| tiup update cluster --force | ||
| ``` | ||
|
|
||
| 2. 升级后,部署包含监控节点的新集群时,应当能正常显示监控。 | ||
|
|
||
| 3. 对于现有集群,可通过再次启动集群的方法汇报监控地址(将 `CLUSTER_NAME` 替换为实际集群名称): | ||
|
|
||
| ```bash | ||
| tiup cluster start CLUSTER_NAME | ||
| ``` | ||
|
|
||
| 即使集群已经启动,请仍然执行该命令。该命令不会影响集群上正常的业务,但会刷新并上报监控地址,从而能让监控在 TiDB Dashbaord 中正常显示。 | ||
|
|
||
| ### 概况页面中 Top SQL 语句、最近慢查询显示 `invalid connection` 错误 | ||
|
|
||
| 可能的原因是你开启了 TiDB 的 `prepared-plan-cache` 功能。作为实验性功能,`prepared-plan-cache` 在某些版本的 TiDB 中存在一些缺陷,开启后可能会导致 TiDB Dashboard(及其他应用)出现该问题。请依据[文档](/tidb-configuration-file.md#prepared-plan-cache)关闭 `prepared-plan-cache` 功能。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| title: TiDB Dashboard 介绍 | ||
| category: how-to | ||
| --- | ||
|
|
||
| # TiDB Dashboard 介绍 | ||
|
|
||
| TiDB Dashboard 是 TiDB 自 4.0 版本起提供的图形化界面,可用于监控及诊断 TiDB 集群。TiDB Dashboard 内置于 TiDB 的 PD 组件中,无需独立部署。 | ||
|
|
||
|  | ||
|
|
||
| TiDB Dashboard 在 GitHub 上[开源](https://github.com/pingcap-incubator/tidb-dashboard)。 | ||
|
|
||
| 以下列出了 TiDB Dashboard 的主要功能,可分别点击小节内的链接进一步了解详情。 | ||
|
|
||
| ## 了解集群整体运行概况 | ||
|
|
||
| 查看集群整体 QPS 数值、执行耗时、消耗资源最多的几类 SQL 语句等概况信息。 | ||
|
|
||
| 参阅[概况页面](/dashboard/dashboard-overview.md)了解详情。 | ||
|
|
||
| ## 查看组件及主机运行状态 | ||
|
|
||
| 查看整个集群中 TiDB、TiKV、PD、TiFlash 组件的运行状态及其所在主机的运行状态。 | ||
|
|
||
| 参阅[集群信息页面](/dashboard/dashboard-cluster-info.md)了解详情。 | ||
|
|
||
| ## 分析集群读写流量分布及趋势变化 | ||
|
|
||
| 通过热力图形式可视化地展示整个集群中读写流量随时间的变化情况,及时发现业务模式的变化,或定位性能不均衡的热点所在。 | ||
|
|
||
| 参阅[流量可视化页面](/dashboard/dashboard-key-visualizer.md)了解详情。 | ||
|
|
||
| ## 列出所有 SQL 查询的耗时等执行信息 | ||
|
|
||
| 列出所有 SQL 语句在集群上执行情况,了解各个阶段的执行时间、总运行次数等信息,帮助用户分析和定位集群中最消耗资源的查询,优化整体性能。 | ||
|
|
||
| 参阅 [SQL 语句分析页面](/dashboard/dashboard-statement-list.md)了解详情。 | ||
|
|
||
| ## 详细了解耗时较长的 SQL 语句的执行信息 | ||
|
|
||
| 列出所有耗时较长的 SQL 语句文本及其执行信息,帮助用户定位 SQL 语句性能缓慢或发生性能抖动的原因。 | ||
|
|
||
| 参阅[慢查询页面](/dashboard/dashboard-slow-query.md)了解详情。 | ||
|
|
||
| ## 诊断常见集群问题并生成报告 | ||
|
|
||
| 自动判断集群中是否存在一些常见的风险(如配置不一致)或问题,生成报告并给出操作建议,或对比集群在不同时间段的各个指标状态,供用户分析可能存在问题的方向。 | ||
|
|
||
| 参阅[集群诊断页面](/dashboard/dashboard-diagnostics-access.md)了解详情。 | ||
|
|
||
| ## 查询所有组件日志 | ||
|
|
||
| 按关键字、时间范围等条件快速搜索集群中所有运行实例的日志,并可打包下载到本地。 | ||
|
|
||
| 参阅[日志搜索页面](/dashboard/dashboard-log-search.md)了解详情。 | ||
|
|
||
| ## 收集分析各个组件的性能数据 | ||
|
|
||
| 高级调试功能:无需第三方工具,在线地对各个组件进行性能分析,剖析组件实例在分析时间段内执行的各种内部操作及比例。 | ||
|
|
||
| 参阅[实例性能分析页面](/dashboard/dashboard-profiling.md)了解详情。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| --- | ||
| title: 部署 TiDB Dashboard | ||
| category: how-to | ||
| --- | ||
|
|
||
| # 部署 TiDB Dashboard | ||
|
|
||
| TiDB Dashboard 界面内置于 TiDB 4.0 或更高版本的 PD 组件中,无需额外部署。只需部署标准 TiDB 集群,TiDB Dashboard 就会原生集成。 | ||
|
|
||
| 请参阅下列文档了解如何部署标准 TiDB 集群: | ||
|
|
||
| + [快速试用 TiDB 集群](/quick-start-with-tidb.md#第二种使用-tiup-playground-快速部署本地测试环境) | ||
| + [生产环境部署](/production-deployment-using-tiup.md) | ||
| + [Kubernetes 环境部署](https://pingcap.com/docs-cn/tidb-in-kubernetes/stable/access-dashboard/) | ||
|
|
||
| > **注意:** | ||
| > | ||
| > TiDB Dashboard 目前不能在低于 4.0 版本的集群中部署或使用。 | ||
|
|
||
| ## 多 PD 实例部署 | ||
|
|
||
| 当集群中部署了多个 PD 实例时,其中仅有一个 PD 实例会固定地提供 TiDB Dashboard 服务。 | ||
|
|
||
| 各个 PD 首次运行时会自动协商出其中某一个实例提供 TiDB Dashboard 服务。协商完毕后,无论重启或扩容,都会固定在这个实例上运行 TiDB Dashboard 服务,除非该实例被手动缩容。其他 PD 实例不会运行 TiDB Dashboard 服务。这个协商过程无需用户介入,会自动完成。 | ||
|
|
||
| 当用户访问不提供 TiDB Dashboard 服务的 PD 实例时,浏览器将会收到重定向指令,自动引导用户重新访问提供了 TiDB Dashboard 服务的 PD 实例,从而能正常使用。流程如下图所示。 | ||
|
|
||
|  | ||
|
|
||
| > **注意:** | ||
| > | ||
| > 提供 TiDB Dashboard 服务的 PD 实例不一定与 PD leader 一致。 | ||
|
|
||
| ### 查询实际运行 TiDB Dashboard 服务的 PD 实例 | ||
|
|
||
| 使用 TiUP 部署时,对于已启动的集群,可通过 `tiup cluster display` 命令查看哪个 PD 节点提供了 TiDB Dashboard 服务(将 `CLUSTER_NAME` 替换为集群名称): | ||
|
|
||
| ```bash | ||
| tiup cluster display CLUSTER_NAME --dashboard | ||
| ``` | ||
|
|
||
| 输出样例如下: | ||
|
|
||
| ``` | ||
| http://192.168.0.123:2379/dashboard/ | ||
| ``` | ||
|
|
||
| > **注意:** | ||
| > | ||
| > 该功能仅在较新版本的 `tiup cluster` 部署工具中提供。可通过以下命令升级 `tiup cluster`: | ||
| > | ||
| > ```bash | ||
| > tiup update --self | ||
| > tiup update cluster --force | ||
| > ``` | ||
|
|
||
| ### 切换其他 PD 实例提供 TiDB Dashboard 服务 | ||
|
|
||
| 使用 TiUP 部署时,对于已启动的集群,可使用 `tiup ctl pd` 命令切换其他 PD 实例运行 TiDB Dashboard,或在禁用 TiDB Dashboard 的情况下重新指定一个 PD 实例运行 TiDB Dashboard: | ||
|
|
||
| ```bash | ||
| tiup ctl pd -u http://127.0.0.1:2379 config set dashboard-address http://9.9.9.9:2379 | ||
| ``` | ||
|
|
||
| 其中: | ||
|
|
||
| - 将 `127.0.0.1:2379` 替换为任意 PD 实例的 IP 和端口 | ||
| - 将 `9.9.9.9:2379` 替换为想运行 TiDB Dashboard 服务的新 PD 实例的 IP 和端口 | ||
|
|
||
| 修改完毕后,可使用 `tiup cluster display` 命令确认修改是否生效(将 `CLUSTER_NAME` 替换为集群名称): | ||
|
|
||
| ```bash | ||
| tiup cluster display CLUSTER_NAME --dashboard | ||
| ``` | ||
|
|
||
| > **警告:** | ||
| > | ||
| > 切换 TiDB Dashboard 将会丢失之前 TiDB Dashboard 实例所存储的本地数据,包括流量可视化历史、历史搜索记录等。 | ||
|
|
||
| ## 禁用 TiDB Dashboard | ||
|
|
||
| 使用 TiUP 部署时,对于已启动的集群,可使用 `tiup ctl pd` 命令在所有 PD 实例上禁用 TiDB Dashboard(将 `127.0.0.1:2379` 替换为任意 PD 实例的 IP 和端口): | ||
|
|
||
| ```bash | ||
| tiup ctl pd -u http://127.0.0.1:2379 config set dashboard-address none | ||
| ``` | ||
|
|
||
| 禁用 TiDB Dashboard 后,查询哪个 PD 实例提供 TiDB Dashboard 服务将会失败: | ||
|
|
||
| ``` | ||
| Error: TiDB Dashboard is disabled | ||
| ``` | ||
|
|
||
| 浏览器访问任意 PD 实例的 TiDB Dashboard 地址也将提示失败: | ||
|
|
||
| ``` | ||
| Dashboard is not started. | ||
| ``` | ||
|
|
||
| ## 重新启用 TiDB Dashboard | ||
breezewish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 使用 TiUP 部署时,对于已启动的集群,可使用 `tiup ctl pd` 命令,要求 PD 重新协商出某一个实例运行 TiDB Dashboard(将 `127.0.0.1:2379` 替换为任意 PD 实例的 IP 和端口): | ||
|
|
||
| ```bash | ||
| tiup ctl pd -u http://127.0.0.1:2379 config set dashboard-address auto | ||
| ``` | ||
|
|
||
| 修改完毕后,使用 `tiup cluster display` 命令查看 PD 自动协商出的 TiDB Dashboard 实例地址(将 `CLUSTER_NAME` 替换为集群名称): | ||
|
|
||
| ```bash | ||
| tiup cluster display CLUSTER_NAME --dashboard | ||
| ``` | ||
|
|
||
| 还可以通过手动指定哪个 PD 实例运行 TiDB Dashboard 服务的方式重新启用 TiDB Dashboard,具体操作参见上文[切换其他 PD 实例提供 TiDB Dashboard 服务](#切换其他-PD-实例提供-TiDB-Dashboard-服务)。 | ||
|
|
||
| > **警告:** | ||
| > | ||
| > 若新启用的 TiDB Dashboard 实例与禁用前的实例不一致,将会丢失之前 TiDB Dashboard 实例所存储的本地数据,包括流量可视化历史、历史搜索记录等。 | ||
|
|
||
| ## 下一步 | ||
|
|
||
| - 参阅[访问 TiDB Dashboard](/dashboard/dashboard-access.md) 章节了解如何访问及登录集群上的 TiDB Dashboard 界面。 | ||
|
|
||
| - 参阅[提高 TiDB Dashboard 安全性](/dashboard/dashboard-ops-security.md) 章节了解如何增强 TiDB Dashboard 的安全性,如配置防火墙等。 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.