-
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
ticdc: add description about ticdc new architecture #19765
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Co-authored-by: Flowyi <flowbehappy@gmail.com>
@wlwilliamx: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
/CC @flowbehappy
@wlwilliamx: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Co-authored-by: wlwilliamx <53336371+wlwilliamx@users.noreply.github.com>
Co-authored-by: wlwilliamx <53336371+wlwilliamx@users.noreply.github.com>
…ocs-cn into ldz/add-ticdc-new-arch
6de9f00
to
4a0d176
Compare
Co-authored-by: Flowyi <flowbehappy@gmail.com>
@flowbehappy: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@lidezhu: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
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.
@flowbehappy PTAL
|
||
 | ||
|
||
## 使用指南 |
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.
## 使用指南 | |
## 新架构部署指南 |
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.
“部署指南” 感觉应该足够了,不用再加 “新架构”
``` | ||
|
||
3. 参考[恢复同步任务](/ticdc/ticdc-manage-changefeed.md#恢复同步任务)恢复所有的 Changefeed 同步任务; | ||
|
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.
## 新架构命令使用指南 | |
在部署完新架构的节点之后,即可使用新架构的命令来操作新架构的 TiCDC 节点了。 | |
新架构的使用命令与老架构采用的是同一套命令逻辑,需要注意的是要在命令中加上一个标志或者设置一个环境变量来让新架构的 TiCDC 节点执行命令。下面是使用方式的具体说明: | |
### 方式一:使用 `--newarch` 或 `-x` 标志 | |
如果想让新架构的 TiCDC 节点执行某个命令,可以在命令中添加 `--newarch`(或 `-x`)标志。例如: | |
``` | |
cdc --newarch cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" | |
``` | |
或使用 `-x` 的简写形式: | |
``` | |
cdc -x cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" | |
``` | |
这样便可在新架构的 TiCDC 节点中创建 Changefeed。 | |
如果不加 `--newarch` 或 `-x` 标志,将默认让老架构的 TiCDC 节点执行命令: | |
``` | |
# 默认使用老架构 | |
cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" | |
``` | |
这样依旧是在老架构的 TiCDC 节点中创建 Changefeed。 | |
### 方式二:使用 `TICDC_NEWARCH` 环境变量 | |
若需要经常手动执行命令操作 TiCDC 新架构,可设置环境变量 `TICDC_NEWARCH=true`,这样当前终端会话中的所有 TiCDC 命令都会采用新架构。例如: | |
``` | |
export TICDC_NEWARCH=true # 在当前终端会话中,之后所有的 TiCDC 命令都会采用新架构 | |
# 现在默认使用的是新架构,在新架构 TiCDC 节点中创建 Changefeed | |
cdc cli changefeed create cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" | |
``` | |
如果需要切换回老架构,可以取消该环境变量: | |
``` | |
unset TICDC_NEWARCH | |
# 重新默认使用老架构,在老架构 TiCDC 节点中创建 Changefeed | |
cdc cli changefeed create cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" | |
``` | |
### 常见命令示例 | |
以下是一些 TiCDC 相关命令在新架构下的常见使用示例。 | |
1. **在新架构的 TiCDC 节点中创建 Changefeed** | |
* 添加 `--newarch` 或 `-x` 标志: | |
``` | |
cdc -x cli changefeed create cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" | |
``` | |
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构: | |
``` | |
export TICDC_NEWARCH=true | |
cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" | |
``` | |
2. **查看 Changefeed 列表** | |
* 添加 `--newarch` 或 `-x` 标志: | |
``` | |
cdc -x cli changefeed list --server=http://10.0.10.25:8300 | |
``` | |
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构: | |
``` | |
export TICDC_NEWARCH=true | |
cdc cli changefeed list --server=http://10.0.10.25:8300 | |
``` | |
3. **暂停 Changefeed** | |
* 添加 `--newarch` 或 `-x` 标志: | |
``` | |
cdc -x cli changefeed pause --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task | |
``` | |
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构: | |
``` | |
export TICDC_NEWARCH=true | |
cdc cli changefeed pause --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task | |
``` | |
4. **恢复 Changefeed** | |
* 添加 `--newarch` 或 `-x` 标志: | |
``` | |
cdc -x cli changefeed resume --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task | |
``` | |
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构: | |
``` | |
export TICDC_NEWARCH=true | |
cdc cli changefeed resume --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task | |
``` | |
5. **删除 Changefeed** | |
* 添加 `--newarch` 或 `-x` 标志: | |
``` | |
cdc -x cli changefeed remove --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task | |
``` | |
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构: | |
``` | |
export TICDC_NEWARCH=true | |
cdc cli changefeed remove --server=http://10.0.10.25:8300 --changefeed-id simple-replication-task | |
``` | |
6. **查询特定 Changefeed 信息** | |
* 添加 `--newarch` 或 `-x` 标志: | |
``` | |
cdc -x cli changefeed query -s --server=http://10.0.10.25:8300 --changefeed-id=simple-replication-task | |
``` | |
* 设置 `TICDC_NEWARCH` 环境变量,后续该终端会话下的所有 TiCDC 命令都无需额外设置即可使用新架构: | |
``` | |
export TICDC_NEWARCH=true | |
cdc cli changefeed query -s --server=http://10.0.10.25:8300 --changefeed-id=simple-replication-task | |
``` | |
7. **查看可用命令** | |
由于新架构仍在逐步完善,部分命令可能尚未支持。可以使用以下命令查看当前架构下的可用命令: | |
* 查看新架构当前支持的命令: | |
``` | |
cdc --newarch help # 或者使用 -x | |
``` | |
* 对比查看老架构当前支持的命令: | |
``` | |
cdc help | |
``` | |
在未来版本中,我们将逐步增加对 TiCDC 新架构更多命令的支持,请关注后续版本更新,以获取最新功能支持。 |
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.
”常见命令示例” 这一部分太冗长了,建议直接链接到老架构的操作指南的页面,再简单说明一下即可。
@wlwilliamx: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?