Skip to content

Commit

Permalink
ticdc: remove canal protocol (pingcap#16859)
Browse files Browse the repository at this point in the history
  • Loading branch information
wk989898 authored Mar 27, 2024
1 parent 9bc6204 commit 4294914
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions ticdc/ticdc-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ TiCDC 为 service GC safepoint 设置的默认存活有效期为 24 小时,即
* 同步所有的非系统表
* 只同步包含[有效索引](/ticdc/ticdc-overview.md#最佳实践)的表

## TiCDC 是否支持输出 Canal 格式的变更数据
## TiCDC 是否支持输出 Canal 协议的变更数据

支持。要开启 Canal 格式输出,只需在 `--sink-uri` 中指定 protocol 为 `canal` 即可例如:
支持。注意:对于 Canal 协议,TiCDC 只支持 JSON 输出格式,对 protobuf 格式尚未提供官方支持。要开启 Canal 协议的输出,只需在 `--sink-uri` 配置中指定 `protocol``canal-json` 即可例如:

```shell
cdc cli changefeed create --server=http://127.0.0.1:8300 --sink-uri="kafka://127.0.0.1:9092/cdc-test?kafka-version=2.4.0&protocol=canal" --config changefeed.toml
cdc cli changefeed create --server=http://127.0.0.1:8300 --sink-uri="kafka://127.0.0.1:9092/cdc-test?kafka-version=2.4.0&protocol=canal-json" --config changefeed.toml
```

> **注意:**
>
> * 该功能在 TiCDC 4.0.2 版本引入。
> * 目前 TiCDC 仅支持将 Canal 格式的变更数据输出到 MQ 类的 Sink(例如 Kafka)。
> * 目前 TiCDC 仅支持将 Canal-JSON 格式的变更数据输出到 MQ 类的 Sink(例如 Kafka)。
更多信息请参考 [TiCDC Changefeed 配置参数](/ticdc/ticdc-changefeed-config.md)

Expand Down Expand Up @@ -338,4 +338,4 @@ TiDB 有事务超时的机制,当事务运行超过 [`max-txn-ttl`](/tidb-conf
}
}
]
```
```
2 changes: 1 addition & 1 deletion ticdc/ticdc-open-api-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ curl -X GET http://127.0.0.1:8300/api/v2/health
| `date_separator` | `STRING` 类型,文件路径的日期分隔类型。可选类型有 `none``year``month``day`。默认值为 `none`,即不使用日期分隔。(非必选) |
| `dispatchers` | 事件分发配置数组。(非必选) |
| `encoder_concurrency` | `INT` 类型。MQ sink 中编码器的线程数。默认值为 `16`。(非必选) |
| `protocol` | `STRING` 类型,对于 MQ 类的 Sink,可以指定消息的协议格式。目前支持以下协议:`canal-json``open-protocol``canal``avro``maxwell`|
| `protocol` | `STRING` 类型,对于 MQ 类的 Sink,可以指定消息的协议格式。目前支持以下协议:`canal-json``open-protocol``avro``maxwell`|
| `schema_registry` | `STRING` 类型,schema registry 地址。(非必选) |
| `terminator` | `STRING` 类型,换行符,用来分隔两个数据变更事件。默认值为空,表示使用 `"\r\n"` 作为换行符。(非必选) |
| `transaction_atomicity` | `STRING` 类型,事务一致性等级。(非必选) |
Expand Down
2 changes: 1 addition & 1 deletion ticdc/ticdc-open-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ curl -X GET http://127.0.0.1:8300/api/v1/health

`matcher`:匹配语法和过滤器规则语法相同。

`protocol`:对于 MQ 类的 Sink,可以指定消息的协议格式。目前支持 `canal-json``open-protocol``canal``avro``maxwell` 五种协议。
`protocol`:对于 MQ 类的 Sink,可以指定消息的协议格式。目前支持 `canal-json``open-protocol``avro``maxwell` 五种协议。

### 使用样例

Expand Down
2 changes: 1 addition & 1 deletion ticdc/ticdc-sink-to-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ URI 中可配置的的参数如下:
| `replication-factor` | Kafka 消息保存副本数(可选,默认值 `1`),需要大于等于 Kafka 中 [`min.insync.replicas`](https://kafka.apache.org/33/documentation.html#brokerconfigs_min.insync.replicas) 的值。 |
| `required-acks` |`Produce` 请求中使用的配置项,用于告知 broker 需要收到多少副本确认后才进行响应。可选值有:`0``NoResponse`:不发送任何响应,只有 TCP ACK),`1``WaitForLocal`:仅等待本地提交成功后再响应)和 `-1``WaitForAll`:等待所有同步副本提交后再响应。最小同步副本数量可通过 broker 的 [`min.insync.replicas`](https://kafka.apache.org/33/documentation.html#brokerconfigs_min.insync.replicas) 配置项进行配置)。(可选,默认值为 `-1`)。 |
| `compression` | 设置发送消息时使用的压缩算法(可选值为 `none``lz4``gzip``snappy``zstd`,默认值为 `none`)。注意 Snappy 压缩文件必须遵循[官方 Snappy 格式](https://github.com/google/snappy)。不支持其他非官方压缩格式。|
| `protocol` | 输出到 Kafka 的消息协议,可选值有 `canal-json``open-protocol``canal``avro``maxwell`|
| `protocol` | 输出到 Kafka 的消息协议,可选值有 `canal-json``open-protocol``avro``maxwell`|
| `auto-create-topic` | 当传入的 `topic-name` 在 Kafka 集群不存在时,TiCDC 是否要自动创建该 topic(可选,默认值 `true`)。 |
| `enable-tidb-extension` | 可选,默认值是 `false`。当输出协议为 `canal-json` 时,如果该值为 `true`,TiCDC 会发送 [WATERMARK 事件](/ticdc/ticdc-canal-json.md#watermark-event),并在 Kafka 消息中添加 TiDB 扩展字段。从 6.1.0 开始,该参数也可以和输出协议 `avro` 一起使用。如果该值为 `true`,TiCDC 会在 Kafka 消息中添加[三个 TiDB 扩展字段](/ticdc/ticdc-avro-protocol.md#tidb-扩展字段)|
| `max-batch-size` | 从 v4.0.9 开始引入。当消息协议支持把多条变更记录输出至一条 Kafka 消息时,该参数用于指定这一条 Kafka 消息中变更记录的最多数量。目前,仅当 Kafka 消息的 `protocol``open-protocol` 时有效(可选,默认值 `16`)。|
Expand Down

0 comments on commit 4294914

Please sign in to comment.