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

*: replace loader by lightning #2243

Merged
merged 15 commits into from Feb 15, 2020
Merged

*: replace loader by lightning #2243

merged 15 commits into from Feb 15, 2020

Conversation

IANTHEREAL
Copy link
Contributor

What is changed, added or deleted?

we don't recommend to use loader any more in TiDB v3.0/3.1/.., and lightning will take place of loader

What is the related PR or file link(s)?

  • Reference link(s):
  • This PR is to align with:
  • N/A (not applicable)

Which TiDB version(s) does your changes apply to?

  • All active versions: dev, v3.0, v2.1, v3.1
  • dev (the latest development version)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)
  • v3.1 (TiDB 3.1 versions)
  • v4.0 (TiDB 4.0 versions)
  • All active and inactive versions
  • N/A (not applicable)

Note: If your changes apply to multiple TiDB versions, make sure you update the documents in the corresponding version folders such as "dev", "v3.0", "v2.1" and "v3.1" in this PR.

  • Updated one version first. Will update other versions after I get two LGTMs.

@IANTHEREAL
Copy link
Contributor Author

IANTHEREAL commented Feb 14, 2020

@WangXiangUSTC @kennytm @liukun4515 PTAL

@@ -60,7 +60,7 @@
+ 运维
- [Ansible 常见运维操作](/dev/how-to/maintain/ansible-operations.md)
+ 备份与恢复
- [使用 Mydumper/Loader 进行备份与恢复](/dev/how-to/maintain/backup-and-restore/mydumper-loader.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

如果 lightning 完全可以代替 loader 的方式,loader 的文档可以去掉,否则建议保留 2 种

Copy link
Contributor Author

Choose a reason for hiding this comment

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

不会移除 loader,只是不在官方备份恢复推荐使用方案中。

dev/TOC.md Outdated
@@ -60,7 +60,7 @@
+ 运维
- [Ansible 常见运维操作](/dev/how-to/maintain/ansible-operations.md)
+ 备份与恢复
- [使用 Mydumper/Loader 进行备份与恢复](/dev/how-to/maintain/backup-and-restore/mydumper-loader.md)
- [使用 Mydumper/Loader 进行备份与恢复](/dev/how-to/maintain/backup-and-restore/mydumper-lightning.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
- [使用 Mydumper/Loader 进行备份与恢复](/dev/how-to/maintain/backup-and-restore/mydumper-lightning.md)
- [使用 Mydumper/Lightning 进行备份与恢复](/dev/how-to/maintain/backup-and-restore/mydumper-lightning.md)

@TomShawn TomShawn added dev translation/doing This PR’s assignee is translating this PR. size/large Changes of a large size. labels Feb 14, 2020
@TomShawn TomShawn changed the title replace loader by lightning *: replace loader by lightning Feb 14, 2020
Copy link
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

rest LGTM


为了快速地备份恢复数据 (特别是数据量巨大的库),可以参考以下建议:

* 使用 Mydumper 导出来的数据文件尽可能的小,最好不要超过 64M,可以将参数 `-F` 设置为 64。
* Loader的 `-t` 参数可以根据 TiKV 的实例个数以及负载进行评估调整,推荐设置为 32。当 TiKV 负载过高,Loader 以及 TiDB 日志中出现大量 `backoffer.maxSleep 15000ms is exceeded` 时,可以适当调小该值;当 TiKV 负载不是太高的时候,可以适当调大该值。
* 使用 `mydumper` 导出来的数据文件尽可能的小, 可以通过设置参数 `-F` 来控制导出来的文件大小。如果后续使用 TiDB Lightning 对备份文件进行恢复,建议把 `mydumper` -F 参数的值设置为 `256`(单位 MB);如果使用 `loader` 恢复,则建议设置为 `64`(单位 MB)。
Copy link
Contributor

Choose a reason for hiding this comment

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

这里要不要把 loader 删掉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里可以留在这里,提及一下


为了快速地备份恢复数据 (特别是数据量巨大的库),可以参考以下建议:

* 使用 `mydumper` 导出来的数据文件尽可能的小, 可以通过设置参数 `-F` 来控制导出来的文件大小。如果后续使用 TiDB Lightning 对备份文件进行恢复,建议把 `mydumper` -F 参数的值设置为 `256`(单位 MB);如果使用 `loader` 恢复,则建议设置为 `64`(单位 MB)。
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

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

The same for v3.0 and v3.1.


本文档将详细介绍如何使用 `mydumper`/`tidb lightning` 对 TiDB 进行全量备份与恢复。增量备份与恢复可使用 [TiDB Binlog](/dev/reference/tidb-binlog/overview.md)。

这里我们假定 TiDB 服务信息如下:
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 服务信息如下
这里假定 TiDB 的服务信息如下

Copy link
Contributor

Choose a reason for hiding this comment

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

在技术文档中,应避免使用第一人称“我”、“我们”。

dev/TOC.md Outdated Show resolved Hide resolved

|Name|Address|Port|User|Password|
|----|-------|----|----|--------|
|TiDB|127.0.0.1|4000|root|*|
Copy link
Contributor

Choose a reason for hiding this comment

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

* = no password?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep


# 备份与恢复

本文档将详细介绍如何使用 `mydumper`/`tidb lightning` 对 TiDB 进行全量备份与恢复。增量备份与恢复可使用 [TiDB Binlog](/dev/reference/tidb-binlog/overview.md)。
Copy link
Contributor

Choose a reason for hiding this comment

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

Either tidb-lightning (the exe name) or "TiDB Lightning" (the product name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

IANTHEREAL and others added 3 commits February 14, 2020 20:16
Co-Authored-By: kennytm <kennytm@gmail.com>
Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>
- [Mydumper](/dev/reference/tools/mydumper.md) 从 TiDB 导出数据
- [TiDB Lightning](/dev/reference/tools/tidb-lightning/overview.md) 导入数据到 TiDB

## 使用 `mydumper`/`TiDB Lightning` 全量备份恢复数据
Copy link
Contributor

Choose a reason for hiding this comment

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

TiDB Lightning 大写的话不用加反引号吧?

v3.0/how-to/maintain/backup-and-restore.md Show resolved Hide resolved
v2.1/TOC.md Show resolved Hide resolved
- [Mydumper](/v3.1/reference/tools/mydumper.md) 从 TiDB 导出数据
- [TiDB Lightning](/v3.1/reference/tools/tidb-lightning/overview.md) 导入数据到 TiDB

## 使用 `mydumper`/`TiDB Lightning` 全量备份恢复数据
Copy link
Contributor

Choose a reason for hiding this comment

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

是否要统一一下,mydumper/TiDB Lightning 还是 mydumper/TiDB Lightning

Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

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

The same for v3.0 and v3.1.


`-t 32` 表明使用 32 个线程去导出数据。`-F 256` 是将实际的 table 切分成多大的 chunk,这里就是 256MB 一个 chunk。

`--skip-tz-utc` 添加这个参数忽略掉 TiDB 与导数据的机器之间时区设置不一致的情况,禁止自动转换。
Copy link
Contributor

Choose a reason for hiding this comment

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

原句几乎读不通。


就再执行两步命令:

1. 执行 `mydumper` 命令前,查询 TiDB 集群的 GC 值并使用 MySQL 客户端将其调整为合适的值。
Copy link
Contributor

@TomShawn TomShawn Feb 14, 2020

Choose a reason for hiding this comment

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

读者可能不知道什么是 GC,这里最好能写全 Garbage Collection (GC),或至少向用户读者提供可参考的页面。


上面,我们使用 `-B test` 表明是对 `test` 这个 database 操作,然后用 `-T t1,t2` 表明只导出 `t1`,`t2` 两张表。

`-t 32` 表明使用 32 个线程去导出数据。`-F 256` 是将实际的 table 切分成多大的 chunk,这里就是 256MB 一个 chunk。
Copy link
Contributor

Choose a reason for hiding this comment

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

切分成多大的 不是正式用语。


本文档将详细介绍如何使用 `mydumper`/`tidb lightning` 对 TiDB 进行全量备份与恢复。增量备份与恢复可使用 [TiDB Binlog](/dev/reference/tidb-binlog/overview.md)。

这里我们假定 TiDB 服务信息如下:
Copy link
Contributor

Choose a reason for hiding this comment

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

在技术文档中,应避免使用第一人称“我”、“我们”。

v3.0/how-to/maintain/backup-and-restore.md Outdated Show resolved Hide resolved
Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

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

LGTM

@IANTHEREAL IANTHEREAL merged commit 67b3f8f into pingcap:master Feb 15, 2020
@IANTHEREAL IANTHEREAL deleted the remove-loader branch February 15, 2020 04:10
@toutdesuite toutdesuite added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/large Changes of a large size. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants