【生产环境】CDC安装失败

【tidb版本】:v4.0.0-rc.1

【tiup版本】:tiup update cluster,升级为最新的版本-v1.0.3

【cdc版本】:通过本地安装cdc wget https://tiup-mirrors.pingcap.com/cdc-v4.0.0-rc-linux-amd64.tar.gz 下载 cdc 包 通过 tiup cluster patch zj_tidb cdc-v4.0.0-rc-linux-amd64.tar.gz -R cdc 的方式升级 cdc

【执行1】tiup cluster patch zj_tidb cdc-v4.0.0-rc-linux-amd64.tar.gz -R cdc 报错。
Starting component cluster: /root/.tiup/components/cluster/v1.0.3/tiup-cluster patch zj_tidb cdc-v4.0.0-rc-linux-amd64.tar.gz -R cdc

Error: initial repository from mirror(https://tiup-mirrors.pingcap.com/) failed: cannot open the initial root.json at /root/.tiup/bin/root.json

Verbose debug logs has been written to /root/.tiup/bin/logs/tiup-cluster-debug-2020-06-08-23-15-58.log.
Error: run /root/.tiup/components/cluster/v1.0.3/tiup-cluster (wd:/root/.tiup/data/S1KkaFz) failed: exit status 1

【执行2】tiup cluster scale-out zj_tidb /apps/tidb/scale-cdc.yaml 也报错
Starting component cluster: /root/.tiup/components/cluster/v1.0.3/tiup-cluster scale-out zj_tidb /apps/tidb/scale-cdc.yamltiup-cluster-debug-2020-05-25-20-21-24.log (88 KB)
tiup-cluster-debug-2020-05-26-09-53-10.log (47.2 KB)
Error: initial repository from mirror(https://tiup-mirrors.pingcap.com/) failed: cannot open the initial root.json at /root/.tiup/bin/root.json

  1. 麻烦执行 tiup cluster display cluster-name 查看当前拓扑信息

  2. 从日志看 component=tidb, version=v4.0.0-rc.2 版本是 rc.2, cdc 您下载的是 rc ?

1.拓扑结构


2.之前测试环境4.0-rc1 通过本地安装CDC本版,但是当时升级tiip cluster版本后0.6.2,扩容CDC节点成功
帖子 见TICDC 启动超时 - #14,来自 lichunzhu-PingCAP


3.当前操作执行当前同样的patch和扩容CDC操作均报错–root.json文件–就不存在

1.tiup update cluster,升级为最新的版本-v1.0.3是否还有必要 tiup cluster patch zj_tidb cdc-v4.0.0-rc-linux-amd64.tar.gz -R cdc 的方式升级 cdc?
2.看到有人提到过.tiup update cluster升级到最新版本的问题。是否也需要这么操作?

  1. 先执行 tiup update --self
  2. cdc 的安装,之前是 GA 没有发吧,当前建议您把集群也升级到 GA,再安装对应的cdc版本。 GA 要比 RC 版本好

你好,目前测试环境和生产环境一样,按照 tiup update --self升级到tidb4.0最新GA版本,可以安装CDC,但是创建任务采用配置文件报错,不识别之前的rc.1版本的的cdc配置文件!有没有最新参看的?cdc-config.toml (435 字节)

./cdc cli changefeed create --pd=http://192.168.150.173:2379 --start-ts=0 --sink-uri=“kafka://192,168.0.1:9092/cdc-scs-topic” --config=/apps/tidb/cdc/cdc-config.toml

Error: component cdc’s config file /apps/tidb/cdc/cdc-config.toml contained unknown configuration options: ignore-txn-commit-ts, filter-case-sensitive, filter-rules, filter-rules.ignore-dbs, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name
Usage:
cdc cli changefeed create [flags]

Flags:
–config string Path of the configuration file
–cyclic-filter-replica-ids uints (Expremental) Cyclic replication filter replica ID of changefeed (default [])
–cyclic-replica-id uint (Expremental) Cyclic replication replica ID of changefeed
–cyclic-sync-ddl (Expremental) Cyclic replication sync DDL of changefeed (default true)
-h, --help help for create
–no-confirm Don’t ask user whether to ignore ineligible table
–opts key=value Extra options, in the key=value format
–sink-uri string sink uri (default “mysql://root:123456@127.0.0.1:3306/”)
–sort-dir string directory used for file sort (default “.”)
–sort-engine string sort engine used for data sort (default “memory”)
–start-ts uint Start ts of changefeed
–target-ts uint Target ts of changefeed

Global Flags:
-i, --interact Run cdc cli with readline
–log-file string log file path (default “cdc.log”)
–log-level string log level (etc: debug|info|warn|error) (default “info”)
–pd string PD address (default “http://127.0.0.1:2379”)

component cdc’s config file /apps/tidb/cdc/cdc-config.toml contained unknown configuration options: ignore-txn-commit-ts, filter-case-sensitive, filter-rules, filter-rules.ignore-dbs, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name, filter-rules.do-tables, filter-rules.do-tables.db-name, filter-rules.do-tables.tbl-name
cdc-config.toml (435 字节)

  1. 当前集群升级到 4.0.0 版本了吗? 再确认下

  1. 看您的文件,没有配置这些信息,看一下 edit-conf里配置的cdc信息

1.已经升级

按照以前的回复:CDC 配置文件可能变动, Open Protocol 格式是稳定的,是不是4.0 GA版本后已经对rc.1版本支持的CDC同步任务的配置文件已经变动?

rc.1版本CDC之前CDC同步任务配置这个文件 cdc-config.toml是有效没有问题,升级到4.0 GA版本后,创建同步任务报不识别配置选项。。。。

因为 TiCDC RC 版本尚未有用户在生产环境上使用,为了提升 TiCDC 的易用性,我们在 4.0.0 版本做了一些不兼容的变更:

1、优化了 Changefeed 配置文件格式

2、优化了 PD 维护的 TiCDC 元数据结构

以上两个修改导致从 TiCDC RC 版本直接升级到 4.0.0 版本时,TiCDC 会报错。

升级方案:

1、停止 cdc server 进程:

tiup cluster stop -R cdc

2、升级集群:

tiup cluster upgrade 4.0.0

3、清空 PD 中存储的 TiCDC 元数据:

cdc cli meta delete —pd=xxxxx

4、使用 4.0.0 版本的 cdc binary 重建 changefeed:

cdc cli changefeed create xxxx

请注意 CDC 目前仍然是实验特性,不建议在生产环境使用。

4.0.0 版本相对于 rc.1版本配置文件格式是有改动的,目前官网文档仍然没有体现 changefeed 配置文件,这就意味着,配置文件目前仍然不稳定。

你好,目前我们是全新的系统数据量不大,目前采用CDC的化1.能提供最新的CDC任务的配置文件模板?2.其他的方式设置过滤的相关表?

您好,请参见:https://github.com/pingcap/ticdc/blob/v4.0.0/cmd/changefeed.toml

你好:
关于这个最新的配置文件有几个问题:
我这百年同步到KAFKA

  1. default, ts, rowid and table 四种有什么区别,对应什么场景?
    [sink]

对于 MQ 类的 Sink,可以通过 dispatch-rules 配置 event 分发规则

分发规则支持 default, ts, rowid, table

For MQ Sinks, you can configure event distribution rules through dispatch-rules

Distribution rules support default, ts, rowid and table
dispatch-rules = [
{db-name = “scs”, tbl-name = “c_content_record”, rule = “default”},
{db-name = “scs”, tbl-name = “c_common_config”, rule = “default”},
{db-name = “scs”, tbl-name = “c_content_comment”, rule = “default”},
{db-name = “scs”, tbl-name = “c_user_base”, rule = “default”},
]

2.replica-id和filter-replica-ids 怎么理解,需要怎么设置

目前我们这边需要同步四张表,配置文件见附件,麻烦看下是否配置有误。

cdc-config.toml (2.0 KB)

1、请问您下游是kafka吗?如果不是kafka 不需要理会这个。 如果是 kafka ,这里设定了对某张表的分发方式 :

default 的分发模式: 如果某张表只存在一个主键或者唯一索引,则将主键(唯一索引)值计算hash,通过 hash 将每一行的 change log event 分发到不同的 partition; 如果某张表存在多个主键或者唯一索引,则将 table name 计算 hash,通过 hash 将每一行的 change log event 分发到不同的 partition;

ts 分发模式: 按照 change log 的 commit ts 分发 partition,这种方式会破坏change log 的有序性

rowid 分发模式: 按照 changelog 的 rowid 分发 partition,当上游某张表存在多个主键或唯一索引时,这种方式可能会导致下游的主键\唯一索引冲突

table 分发模式: 按照 changelog 的 table 分发partition,这种方式并行度较低

2、replica-id和filter-replica-ids 是环形复制相关配置,不需要关心

在你提供的配置文件中;dispatch-rules按需调整即可;其他没问题

你好: 我们下游是kafka 目前测试环境已经可以同步数据,今天晚上零点我们会在生产环境进行tidb4.0GA升级及cdc的部署

好的,有问题,再反馈,多谢。