-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
tools, readme: add pd recover usage document #818
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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 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,39 @@ | ||
--- | ||
title: PD Recover 使用文档 | ||
category: tools | ||
--- | ||
|
||
# PD Recover 使用文档 | ||
|
||
PD Recover 是对 PD 进行灾难性恢复的工具,用于恢复无法正常启动或服务的 PD 集群。 | ||
|
||
## 源码编译 | ||
|
||
1. [Go](https://golang.org/) Version 1.9 以上 | ||
2. 在 PD 项目根目录使用 `make` 命令进行编译,生成 `bin/pd-recover` | ||
|
||
## 使用方法 | ||
|
||
### 参数说明 | ||
|
||
``` | ||
-alloc-id uint | ||
指定比原集群已分配过的 ID 更大的数 | ||
-cacert string | ||
指定 PEM 格式的受信任 CA 的证书文件路径 | ||
-cert string | ||
指定 PEM 格式的 SSL 证书文件路径 | ||
-key string | ||
指定 PEM 格式的 SSL 证书密钥文件路径,即 `--cert` 所指定的证书的私钥 | ||
-cluster-id uint | ||
指定原集群的 cluster ID | ||
-endpoints string | ||
指定 PD 的地址 (default "http://127.0.0.1:2379") | ||
``` | ||
|
||
### 恢复流程 | ||
|
||
1. 从当前集群中找到集群的 Cluster ID 和 Alloc ID。一般 Cluster ID 可以从 PD,TiKV 或 TiDB 的日志中都可以获取。已经分配过的 Alloc ID 可以从 PD 日志获得 。另外也可以从 PD 的监控面板的 Metadata Information 监控项中获得。在指定 alloc-id 时需指定一个比当前最大的 Alloc ID 更大的值。如果没有途径获取 Alloc ID,可以根据集群中的 Region,Store 数预估一个较大的数,一般可取高几个数量级的数。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
2. 停止整个集群,清空 PD 数据目录,重启 PD 集群。 | ||
3. 使用 PD recover 进行恢复,注意指定正确的 cluster-id 和合适的 alloc-id。 | ||
4. 提示恢复成功后,重启整个集群。 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一般用有序列表(ordered list)描述一个流程,因为流程中的步骤有先后顺序。
列举若干项目时用无序列表(unordered list)。