diff --git a/migrate-from-tidb-to-mysql.md b/migrate-from-tidb-to-mysql.md index 9cc754da5a68..94e6db846559 100644 --- a/migrate-from-tidb-to-mysql.md +++ b/migrate-from-tidb-to-mysql.md @@ -160,12 +160,12 @@ summary: 了解如何将数据从 TiDB 集群迁移至与 MySQL 兼容的数据 在上游集群中,执行以下命令创建从上游到下游集群的同步链路: ```shell - tiup ctl: cdc changefeed create --pd=http://127.0.0.1:2379 --sink-uri="mysql://root:@127.0.0.1:3306" --changefeed-id="upstream-to-downstream" --start-ts="434217889191428107" + tiup ctl: cdc changefeed create --server=http://127.0.0.1:8300 --sink-uri="mysql://root:@127.0.0.1:3306" --changefeed-id="upstream-to-downstream" --start-ts="434217889191428107" ``` 以上命令中: - - `--pd`:实际的上游集群的地址 + - `--server`:TiCDC 集群任意一节点地址 - `--sink-uri`:同步任务下游的地址 - `--changefeed-id`:同步任务的 ID,格式需要符合正则表达式 `^[a-zA-Z0-9]+(\-[a-zA-Z0-9]+)*$` - `--start-ts`:TiCDC 同步的起点,需要设置为实际的备份时间点,也就是[第 2 步:迁移全量数据](/migrate-from-tidb-to-mysql.md#第-2-步迁移全量数据)中 “备份数据” 提到的 BackupTS diff --git a/migrate-from-tidb-to-tidb.md b/migrate-from-tidb-to-tidb.md index 80df5fafe1bf..c45a5dcc302e 100644 --- a/migrate-from-tidb-to-tidb.md +++ b/migrate-from-tidb-to-tidb.md @@ -225,12 +225,12 @@ aliases: ['/zh/tidb/dev/incremental-replication-between-clusters/'] 在上游集群中,执行以下命令创建从上游到下游集群的同步链路: ```shell - tiup cdc cli changefeed create --pd=http://172.16.6.122:2379 --sink-uri="mysql://root:@172.16.6.125:4000" --changefeed-id="upstream-to-downstream" --start-ts="431434047157698561" + tiup cdc cli changefeed create --server=http://172.16.6.122:8300 --sink-uri="mysql://root:@172.16.6.125:4000" --changefeed-id="upstream-to-downstream" --start-ts="431434047157698561" ``` 以上命令中: - - `--pd`:实际的上游集群的地址 + - `--server`:TiCDC 集群中任意一个节点的地址 - `--sink-uri`:同步任务下游的地址 - `--changefeed-id`:同步任务的 ID,格式需要符合正则表达式 ^[a-zA-Z0-9]+(\-[a-zA-Z0-9]+)*$ - `--start-ts`:TiCDC 同步的起点,需要设置为实际的备份时间点,也就是[第 2 步:迁移全量数据](/migrate-from-tidb-to-mysql.md#第-2-步迁移全量数据)中 “备份数据” 提到的 BackupTS @@ -274,7 +274,7 @@ aliases: ['/zh/tidb/dev/incremental-replication-between-clusters/'] ```shell # 停止旧集群到新集群的 changefeed - tiup cdc cli changefeed pause -c "upstream-to-downstream" --pd=http://172.16.6.122:2379 + tiup cdc cli changefeed pause -c "upstream-to-downstream" --server=http://172.16.6.122:8300 # 查看 changefeed 状态 tiup cdc cli changefeed list @@ -297,7 +297,7 @@ aliases: ['/zh/tidb/dev/incremental-replication-between-clusters/'] 2. 创建下游到上游集群的 changefeed。由于此时上下游数据是一致的,且没有新数据写入,因此可以不指定 start-ts,默认为当前时间: ```shell - tiup cdc cli changefeed create --pd=http://172.16.6.125:2379 --sink-uri="mysql://root:@172.16.6.122:4000" --changefeed-id="downstream -to-upstream" + tiup cdc cli changefeed create --server=http://172.16.6.125:8300 --sink-uri="mysql://root:@172.16.6.122:4000" --changefeed-id="downstream -to-upstream" ``` 3. 将写业务迁移到下游集群,观察一段时间后,等新集群表现稳定,便可以弃用原集群。 diff --git a/replicate-between-primary-and-secondary-clusters.md b/replicate-between-primary-and-secondary-clusters.md index 19736ae1d7c1..6e6d625eccf9 100644 --- a/replicate-between-primary-and-secondary-clusters.md +++ b/replicate-between-primary-and-secondary-clusters.md @@ -235,12 +235,12 @@ summary: 了解如何配置一个 TiDB 集群以及该集群的 TiDB 或 MySQL 在上游集群中,执行以下命令创建从上游到下游集群的同步链路: ```shell - tiup cdc cli changefeed create --pd=http://172.16.6.122:2379 --sink-uri="mysql://root:@172.16.6.125:4000" --changefeed-id="primary-to-secondary" --start-ts="431434047157698561" + tiup cdc cli changefeed create --server=http://172.16.6.122:8300 --sink-uri="mysql://root:@172.16.6.125:4000" --changefeed-id="primary-to-secondary" --start-ts="431434047157698561" ``` 以上命令中: - - `--pd`:实际的上游集群的地址 + - `--server`:TiCDC 集群任意一节点的地址 - `--sink-uri`:同步任务下游的地址 - `--start-ts`:TiCDC 同步的起点,需要设置为实际的备份时间点(也就是[第 2 步:迁移全量数据](#第-2-步迁移全量数据)提到的 BackupTS) @@ -314,5 +314,5 @@ tiup cdc redo apply --storage "s3://redo?access-key=minio&secret-access-key=mini ```shell # 创建 changefeed - tiup cdc cli changefeed create --pd=http://172.16.6.122:2379 --sink-uri="mysql://root:@172.16.6.125:4000" --changefeed-id="primary-to-secondary" + tiup cdc cli changefeed create --server=http://172.16.6.122:8300 --sink-uri="mysql://root:@172.16.6.125:4000" --changefeed-id="primary-to-secondary" ``` diff --git a/replicate-data-to-kafka.md b/replicate-data-to-kafka.md index 00f1cf72d396..cc90c44d4c67 100644 --- a/replicate-data-to-kafka.md +++ b/replicate-data-to-kafka.md @@ -58,7 +58,7 @@ aliases: ['/zh/tidb/dev/replicate-incremental-data-to-kafka/'] 2. 创建一个 changefeed,将增量数据输出到 Kafka: ```shell - tiup ctl: cdc changefeed create --pd="http://127.0.0.1:2379" --sink-uri="kafka://127.0.0.1:9092/kafka-topic-name?protocol=canal-json" --changefeed-id="kafka-changefeed" --config="changefeed.conf" + tiup ctl: cdc changefeed create --server="http://127.0.0.1:8300" --sink-uri="kafka://127.0.0.1:9092/kafka-topic-name?protocol=canal-json" --changefeed-id="kafka-changefeed" --config="changefeed.conf" ``` - 如果命令执行成功,将会返回被创建的 changefeed 的相关信息,包含被创建的 changefeed 的 ID 以及相关信息,内容如下: @@ -74,13 +74,13 @@ aliases: ['/zh/tidb/dev/replicate-incremental-data-to-kafka/'] 生产环境下 Kafka 集群通常有多个 broker 节点,你可以在 sink-uri 中配置多个 broker 的访问地址,这有助于提升 changefeed 到 Kafka 集群访问的稳定性,当部分被配置的 Kafka 节点故障的时候,changefeed 依旧可以正常工作。假设 Kafka 集群中有 3 个 broker 节点,地址分别为 127.0.0.1:9092 / 127.0.0.2:9092 / 127.0.0.3:9092,可以参考如下 sink-uri 创建 changefeed: ```shell - tiup ctl: cdc changefeed create --pd="http://127.0.0.1:2379" --sink-uri="kafka://127.0.0.1:9092,127.0.0.2:9092,127.0.0.3:9092/kafka-topic-name?protocol=canal-json&partition-num=3&replication-factor=1&max-message-bytes=1048576" --config="changefeed.conf" + tiup ctl: cdc changefeed create --server="http://127.0.0.1:8300" --sink-uri="kafka://127.0.0.1:9092,127.0.0.2:9092,127.0.0.3:9092/kafka-topic-name?protocol=canal-json&partition-num=3&replication-factor=1&max-message-bytes=1048576" --config="changefeed.conf" ``` 3. Changefeed 创建成功后,执行如下命令,查看 changefeed 的状态: ```shell - tiup ctl: cdc changefeed list --pd="http://127.0.0.1:2379" + tiup ctl: cdc changefeed list --server="http://127.0.0.1:8300" ``` 可以参考[管理 Changefeed](/ticdc/ticdc-manage-changefeed.md),对 changefeed 状态进行管理。 diff --git a/ticdc/deploy-ticdc.md b/ticdc/deploy-ticdc.md index acaacfc18175..f4e9fa7015f3 100644 --- a/ticdc/deploy-ticdc.md +++ b/ticdc/deploy-ticdc.md @@ -111,7 +111,7 @@ tiup cluster upgrade --transfer-timeout 600 ## 使用 TiUP 变更 TiCDC 集群配置 -本节介绍如何使用 TiUP 的 [`tiup cluster edit-config`](/tiup/tiup-component-cluster-edit-config.md) 命令来修改 TiCDC 的配置。在以下例子中,假设需要把 TiCDC 的 `gc-ttl` 从默认值 `86400` 修改为 `3600`,即 1 小时。 +本节介绍如何使用 TiUP 的 [`tiup cluster edit-config`](/tiup/tiup-component-cluster-edit-config.md) 命令来修改 TiCDC 的配置。在以下例子中,假设需要把 TiCDC 的 `gc-ttl` 从默认值 `86400` 修改为 `172800`,即 48 小时。 1. 执行 `tiup cluster edit-config` 命令,注意将 `` 替换成实际的集群名: @@ -131,10 +131,10 @@ tiup cluster upgrade --transfer-timeout 600 pump: {} drainer: {} cdc: - gc-ttl: 86400 + gc-ttl: 172800 ``` - 以上把 TiCDC 的 `gc-ttl` 的值设置为 24 小时。 + 以上把 TiCDC 的 `gc-ttl` 的值设置为 48 小时。 3. 执行 `tiup cluster reload -R cdc` 命令重新加载配置。 diff --git a/ticdc/integrate-confluent-using-ticdc.md b/ticdc/integrate-confluent-using-ticdc.md index 9d5b585521d5..a267fb39408b 100644 --- a/ticdc/integrate-confluent-using-ticdc.md +++ b/ticdc/integrate-confluent-using-ticdc.md @@ -99,7 +99,7 @@ Confluent 是一个兼容 Apache Kafka 的数据流平台,能够访问、存 2. 创建一个 changefeed,将增量数据输出到 Confluent Cloud: ```shell - tiup ctl: cdc changefeed create --pd="http://127.0.0.1:2379" --sink-uri="kafka:///ticdc-meta?protocol=avro&replication-factor=3&enable-tls=true&auto-create-topic=true&sasl-mechanism=plain&sasl-user=&sasl-password=" --schema-registry="https://:@" --changefeed-id="confluent-changefeed" --config changefeed.conf + tiup ctl: cdc changefeed create --server="http://127.0.0.1:8300" --sink-uri="kafka:///ticdc-meta?protocol=avro&replication-factor=3&enable-tls=true&auto-create-topic=true&sasl-mechanism=plain&sasl-user=&sasl-password=" --schema-registry="https://:@" --changefeed-id="confluent-changefeed" --config changefeed.conf ``` 将如下字段替换为[第 2 步:创建 Access Key Pair](#第-2-步创建-access-key-pair)中创建和记录的值: @@ -114,7 +114,7 @@ Confluent 是一个兼容 Apache Kafka 的数据流平台,能够访问、存 其中 `` 需要经过 [HTML URL 编码](https://www.w3schools.com/tags/ref_urlencode.asp)后再替换,替换完毕后示例如下: ```shell - tiup ctl: cdc changefeed create --pd="http://127.0.0.1:2379" --sink-uri="kafka://xxx-xxxxx.ap-east-1.aws.confluent.cloud:9092/ticdc-meta?protocol=avro&replication-factor=3&enable-tls=true&auto-create-topic=true&sasl-mechanism=plain&sasl-user=L5WWA4GK4NAT2EQV&sasl-password=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --schema-registry="https://7NBH2CAFM2LMGTH7:xxxxxxxxxxxxxxxxxx@yyy-yyyyy.us-east-2.aws.confluent.cloud" --changefeed-id="confluent-changefeed" --config changefeed.conf + tiup ctl: cdc changefeed create --server="http://127.0.0.1:8300" --sink-uri="kafka://xxx-xxxxx.ap-east-1.aws.confluent.cloud:9092/ticdc-meta?protocol=avro&replication-factor=3&enable-tls=true&auto-create-topic=true&sasl-mechanism=plain&sasl-user=L5WWA4GK4NAT2EQV&sasl-password=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --schema-registry="https://7NBH2CAFM2LMGTH7:xxxxxxxxxxxxxxxxxx@yyy-yyyyy.us-east-2.aws.confluent.cloud" --changefeed-id="confluent-changefeed" --config changefeed.conf ``` - 如果命令执行成功,将会返回被创建的 changefeed 的相关信息,包含被创建的 changefeed 的 ID 以及相关信息,内容如下: @@ -130,7 +130,7 @@ Confluent 是一个兼容 Apache Kafka 的数据流平台,能够访问、存 3. Changefeed 创建成功后,执行如下命令,查看 changefeed 的状态: ```shell - tiup ctl: cdc changefeed list --pd="http://127.0.0.1:2379" + tiup ctl: cdc changefeed list --server="http://127.0.0.1:8300" ``` 可以参考[管理 Changefeed](/ticdc/ticdc-manage-changefeed.md),对 changefeed 状态进行管理。 diff --git a/ticdc/monitor-ticdc.md b/ticdc/monitor-ticdc.md index e01013f6645c..e88f53b3dd62 100644 --- a/ticdc/monitor-ticdc.md +++ b/ticdc/monitor-ticdc.md @@ -11,7 +11,7 @@ aliases: ['/zh/tidb/dev/ticdc-grafana-dashboard'] 本文档的对指标的介绍基于以下同步任务,即使用默认配置同步数据到 MySQL。 ```shell -cdc cli changefeed create --pd=http://10.0.10.25:2379 --sink-uri="mysql://root:123456@127.0.0.1:3306/" --changefeed-id="simple-replication-task" +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 Dashboard 各监控面板: diff --git a/ticdc/ticdc-avro-protocol.md b/ticdc/ticdc-avro-protocol.md index 85a28e3a6eff..cff3a0a07158 100644 --- a/ticdc/ticdc-avro-protocol.md +++ b/ticdc/ticdc-avro-protocol.md @@ -14,7 +14,7 @@ Avro 是由 [Apache Avro™](https://avro.apache.org/) 定义的一种数据交 使用 Avro 时的配置样例如下所示: ```shell -cdc cli changefeed create --pd=http://127.0.0.1:2379 --changefeed-id="kafka-avro" --sink-uri="kafka://127.0.0.1:9092/topic-name?protocol=avro" --schema-registry=http://127.0.0.1:8081 --config changefeed_config.toml +cdc cli changefeed create --server=http://127.0.0.1:8300 --changefeed-id="kafka-avro" --sink-uri="kafka://127.0.0.1:9092/topic-name?protocol=avro" --schema-registry=http://127.0.0.1:8081 --config changefeed_config.toml ``` ```shell @@ -37,7 +37,7 @@ dispatchers = [ 配置样例如下所示: ```shell -cdc cli changefeed create --pd=http://127.0.0.1:2379 --changefeed-id="kafka-avro-enable-extension" --sink-uri="kafka://127.0.0.1:9092/topic-name?protocol=avro&enable-tidb-extension=true" --schema-registry=http://127.0.0.1:8081 --config changefeed_config.toml +cdc cli changefeed create --server=http://127.0.0.1:8300 --changefeed-id="kafka-avro-enable-extension" --sink-uri="kafka://127.0.0.1:9092/topic-name?protocol=avro&enable-tidb-extension=true" --schema-registry=http://127.0.0.1:8081 --config changefeed_config.toml ``` ```shell @@ -201,7 +201,7 @@ Column 数据格式即 Key/Value 数据格式中的 `{{ColumnValueBlock}}` 部 配置样例如下所示: ```shell -cdc cli changefeed create --pd=http://127.0.0.1:2379 --changefeed-id="kafka-avro-string-option" --sink-uri="kafka://127.0.0.1:9092/topic-name?protocol=avro&avro-decimal-handling-mode=string&avro-bigint-unsigned-handling-mode=string" --schema-registry=http://127.0.0.1:8081 --config changefeed_config.toml +cdc cli changefeed create --server=http://127.0.0.1:8300 --changefeed-id="kafka-avro-string-option" --sink-uri="kafka://127.0.0.1:9092/topic-name?protocol=avro&avro-decimal-handling-mode=string&avro-bigint-unsigned-handling-mode=string" --schema-registry=http://127.0.0.1:8081 --config changefeed_config.toml ``` ```shell diff --git a/ticdc/ticdc-canal-json.md b/ticdc/ticdc-canal-json.md index 1a3a07c0e91c..81430c0648b3 100644 --- a/ticdc/ticdc-canal-json.md +++ b/ticdc/ticdc-canal-json.md @@ -20,7 +20,7 @@ Event 分为三类: 使用 `Canal-JSON` 时的配置样例如下所示: ```shell -cdc cli changefeed create --pd=http://127.0.0.1:2379 --changefeed-id="kafka-canal-json" --sink-uri="kafka://127.0.0.1:9092/topic-name?kafka-version=2.4.0&protocol=canal-json" +cdc cli changefeed create --server=http://127.0.0.1:8300 --changefeed-id="kafka-canal-json" --sink-uri="kafka://127.0.0.1:9092/topic-name?kafka-version=2.4.0&protocol=canal-json" ``` ## TiDB 扩展字段 @@ -33,7 +33,7 @@ Canal-JSON 协议本是为 MySQL 设计的,其中并不包含 TiDB 专有的 C 配置样例如下所示: ```shell -cdc cli changefeed create --pd=http://127.0.0.1:2379 --changefeed-id="kafka-canal-json-enable-tidb-extension" --sink-uri="kafka://127.0.0.1:9092/topic-name?kafka-version=2.4.0&protocol=canal-json&enable-tidb-extension=true" +cdc cli changefeed create --server=http://127.0.0.1:8300 --changefeed-id="kafka-canal-json-enable-tidb-extension" --sink-uri="kafka://127.0.0.1:9092/topic-name?kafka-version=2.4.0&protocol=canal-json&enable-tidb-extension=true" ``` ## Message 格式定义 diff --git a/ticdc/ticdc-manage-changefeed.md b/ticdc/ticdc-manage-changefeed.md index 7c944c579315..7c1557ce24a8 100644 --- a/ticdc/ticdc-manage-changefeed.md +++ b/ticdc/ticdc-manage-changefeed.md @@ -19,7 +19,7 @@ cdc cli changefeed create --server=http://10.0.10.25:8300 --sink-uri="mysql://ro ```shell Create changefeed successfully! ID: simple-replication-task -Info: {"upstream_id":7178706266519722477,"namespace":"default","id":"simple-replication-task","sink_uri":"mysql://root:xxxxx@127.0.0.1:4000/?time-zone=","create_time":"2022-12-19T15:05:46.679218+08:00","start_ts":438156275634929669,"engine":"unified","config":{"case_sensitive":true,"enable_old_value":true,"force_replicate":false,"ignore_ineligible_table":false,"check_gc_safe_point":true,"enable_sync_point":true,"bdr_mode":false,"sync_point_interval":30000000000,"sync_point_retention":3600000000000,"filter":{"rules":["test.*"],"event_filters":null},"mounter":{"worker_num":16},"sink":{"protocol":"","schema_registry":"","csv":{"delimiter":",","quote":"\"","null":"\\N","include_commit_ts":false},"column_selectors":null,"transaction_atomicity":"none","encoder_concurrency":16,"terminator":"\r\n","date_separator":"none","enable_partition_separator":false},"consistent":{"level":"none","max_log_size":64,"flush_interval":2000,"storag +Info: {"upstream_id":7178706266519722477,"namespace":"default","id":"simple-replication-task","sink_uri":"mysql://root:xxxxx@127.0.0.1:4000/?time-zone=","create_time":"2022-12-19T15:05:46.679218+08:00","start_ts":438156275634929669,"engine":"unified","config":{"case_sensitive":true,"enable_old_value":true,"force_replicate":false,"ignore_ineligible_table":false,"check_gc_safe_point":true,"enable_sync_point":true,"bdr_mode":false,"sync_point_interval":30000000000,"sync_point_retention":3600000000000,"filter":{"rules":["test.*"],"event_filters":null},"mounter":{"worker_num":16},"sink":{"protocol":"","schema_registry":"","csv":{"delimiter":",","quote":"\"","null":"\\N","include_commit_ts":false},"column_selectors":null,"transaction_atomicity":"none","encoder_concurrency":16,"terminator":"\r\n","date_separator":"none","enable_partition_separator":false},"consistent":{"level":"none","max_log_size":64,"flush_interval":2000,"storage":""}},"state":"normal","creator_version":"v6.5.0"} ``` ## 查询同步任务列表 diff --git a/ticdc/ticdc-sink-to-mysql.md b/ticdc/ticdc-sink-to-mysql.md index 0cd78d10bbcb..189ade1cdf52 100644 --- a/ticdc/ticdc-sink-to-mysql.md +++ b/ticdc/ticdc-sink-to-mysql.md @@ -41,7 +41,7 @@ Sink URI 用于指定 TiCDC 目标系统的连接信息,遵循以下格式: 一个通用的配置样例如下所示: ```shell ---sink-uri="mysql://root:123456@127.0.0.1:3306/?worker-count=16&max-txn-row=5000&transaction-atomicity=table" +--sink-uri="mysql://root:123456@127.0.0.1:3306" ``` URI 中可配置的参数如下: