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

Add document of dumpling, the new export tool #3151

Merged
merged 25 commits into from
May 26, 2020

Conversation

YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented May 19, 2020

What is changed, added or deleted? (Required)

  • 增加了一篇关于 Dumpling 的 how-to 文档。
  • 为 MyDumper 增加了 Deprecated 信息。

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

@YuJuncen YuJuncen changed the base branch from master to docs-special-week May 19, 2020 09:19
@sre-bot sre-bot added the special-week PR from Document Special Week. label May 19, 2020
@YuJuncen
Copy link
Contributor Author

@3pointer PTAL~

另外还有几个问题需要确认一下:

  • 现在写上 MyDumper 不建议使用合适吗?(Dumpling 还未正式发布)
  • 我们需要强调 Dumpling 还在测试阶段吗?

@TomShawn TomShawn requested review from kissmydb, yikeke and 3pointer May 19, 2020 09:27
@TomShawn TomShawn added the translation/welcome Waits for a contributor to translate this PR and create a PR to the pingcap/docs-cn repository. label May 19, 2020
@yikeke yikeke requested review from WangXiangUSTC and lilin90 May 19, 2020 10:09
@@ -6,6 +6,12 @@ aliases: ['/docs-cn/dev/how-to/maintain/backup-and-restore/mydumper-lightning/',

# 使用 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.

这个文档标题直接改成 使用 dumpling/TiDB Lightning 进行备份与恢复 怎么样?
下面就不用再特殊说明使用 dumpling 替换 mydumper 了
@3pointer 感觉咋样?

Copy link
Contributor

@kissmydb kissmydb May 19, 2020

Choose a reason for hiding this comment

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

如果 dumpling 定位是已经可以代替 mydumper 进行 tidb 的备份,建议 dumpling/TiDB Lightning 进行备份与恢复,然后 mydumper 独立一个文档,用 Deprecated 标识出来。

另外感觉缺一个说明,比如,什么时候选择 dumpling+lightning ,什么时候选择 BR备份,什么时候用 CDC 增量备份,什么时候用 BR 增量备份

Copy link
Contributor

Choose a reason for hiding this comment

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

在 tools 的 use guide 里有这个说明

Copy link
Contributor

Choose a reason for hiding this comment

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

放在 tools 的 guide 里不太合适,用户从备份这里进来,会错过,应该在备份这里加一个总述

export-using-dumpling.md Outdated Show resolved Hide resolved
export-using-dumpling.md Outdated Show resolved Hide resolved

这个命令中,`-H`,`-P`,`-u` 是经典的“地址,端口,用户”三元组。如果需要密码验证,可以用 `-p $YOUR_SECRET_PASSWORD` 传给 Dumpling。

默认情况下,除了系统数据库中的表之外,Dumpling 会导出整个数据库的表。你可以使用 `--where` 来选定要导出的记录。假如导出数据的格式是 CSV(使用 `--filetype csv` 即可导出 CSV 文件),还可以使用 `--sql` 导出指定 SQL 选择出来的记录。
Copy link
Contributor

Choose a reason for hiding this comment

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

不支持指定表的话,--where column=xxx 是如何指定条件呢?可以增加 --where 和 --sql 的例子


默认情况下,导出的文件会存储到 `./export-<current local time>` 目录下。你可以使用 `-o` 来选择存储导出文件的目录。`-F` 选项能够指定单个文件的最大大小(和 MyDumper 不同,这里的单位是字节),与之相似的是 `-r` 选项,它指定单个文件的最大记录数(或者说,数据库中的行数)。利用这些参数可以让 Dumpling 的并行度更高。

除此之外,你可以使用 `--snapshot` 标志来指定欲导出快照的时间戳。与之相关的是 `--consistency`,这个标志控制导出数据“一致性保证”的方式。对于 TiDB 来说,默认情况下我们会通过获取某个时间戳的快照来保证一致性,因此我们才可以使用 `--snapshot` 参数指定要备份的时间戳。
Copy link
Contributor

Choose a reason for hiding this comment

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

这句感觉不太清晰,要先指定--consistency,才能指定--snapshot吗?否则导出的是不一致性的?建议重新组织一下语言

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-overview.md Outdated Show resolved Hide resolved
@lilin90 lilin90 removed the request for review from yikeke May 20, 2020 03:51
mydumper-overview.md Outdated Show resolved Hide resolved
backup-and-restore-using-mydumper-lightning.md Outdated Show resolved Hide resolved
export-data-using-dumpling.md Outdated Show resolved Hide resolved
TOC.md Outdated Show resolved Hide resolved
@lilin90 lilin90 added the status/require-change Needs the author to address comments. label May 20, 2020
@sre-bot sre-bot added the status/PTAL This PR is ready for reviewing. label May 21, 2020
@sre-bot sre-bot requested review from kissmydb and miaoqingli May 21, 2020 03:44
sre-bot pushed a commit to sre-bot/docs-cn that referenced this pull request Jun 5, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>

上述命令中,`-H`、`-P`、`-u` 分别是地址,端口,用户。如果需要密码验证,可以用 `-p $YOUR_SECRET_PASSWORD` 传给 Dumpling。

默认情况下,除了系统数据库中的表之外,Dumpling 会导出整个数据库的表。你可以使用 `--where <SQL where expression>` 来选定要导出的记录。假如导出数据的格式是 CSV(使用 `--filetype csv` 即可导出 CSV 文件),还可以使用 `--sql <SQL>` 导出指定 SQL 选择出来的记录,例如,导出 `test.sbtest1` 中所有 `id < 100` 的记录:
Copy link
Contributor

Choose a reason for hiding this comment

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

s/系统数据库中的表/系统表?是一个意思吗 @YuJuncen

@yikeke
Copy link
Contributor

yikeke commented Jun 5, 2020

/run-cherry-picker

@yikeke
Copy link
Contributor

yikeke commented Jun 5, 2020

/run-cherry-picker

@yikeke
Copy link
Contributor

yikeke commented Jun 5, 2020

/run-cherry-picker

@sre-bot
Copy link
Contributor

sre-bot commented Jun 5, 2020

cherry pick to release-3.1 failed

@yikeke
Copy link
Contributor

yikeke commented Jun 5, 2020

/run-cherry-picker

@sre-bot
Copy link
Contributor

sre-bot commented Jun 5, 2020

cherry pick to release-3.1 failed

@yikeke
Copy link
Contributor

yikeke commented Jun 5, 2020

/run-cherry-picker

@sre-bot
Copy link
Contributor

sre-bot commented Jun 5, 2020

cherry pick to release-3.1 failed

yikeke pushed a commit to sre-bot/docs-cn that referenced this pull request Jun 5, 2020
yikeke added a commit that referenced this pull request Jun 5, 2020
* cherry pick #3497 to release-3.1

Signed-off-by: sre-bot <sre-bot@pingcap.com>

* Update TOC.md

* manually cp from #3151

* relocate

* *: remove content about CDC

Co-authored-by: Xuecheng Zhang <csuzhangxc@gmail.com>
Co-authored-by: yikeke <yikeke@pingcap.com>
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
@yikeke
Copy link
Contributor

yikeke commented Jun 5, 2020

3.1 cp: #3512
3.0 cp: #3519
2.1 cp: #3526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
special-week PR from Document Special Week. status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM. 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.

8 participants