使用Flink CDC 同步 mysql数据到StarRocks

版本信息:
StarRocks: 2.0
Flink:1.13.5
Flink CDC: flink-sql-connector-mysql-cdc-2.1.1.jar
flink-connector-starrocks-1.1.14_flink-1.13_2.12.jar

使用smt生成脚本后,执行下面命令

bin/sql-client.sh -f smt/result/flink-create.1.sql

大部分task会running,但是有些task会出现如下的报错:

Caused by: io.debezium.DebeziumException: A slave with the same server_uuid/server_id as this slave has connected to the master; the first event '' at 4, the last event read from '/sqldata/mysql3308/log-bin.000394' at 51254, the last byte read from '/sqldata/mysql3308/log-bin.000394' at 51254. Error code: 1236; SQLSTATE: HY000.
	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.wrap(MySqlStreamingChangeEventSource.java:1146)
	... 5 more
Caused by: com.github.shyiko.mysql.binlog.network.ServerException: A slave with the same server_uuid/server_id as this slave has connected to the master; the first event '' at 4, the last event read from '/sqldata/mysql3308/log-bin.000394' at 51254, the last byte read from '/sqldata/mysql3308/log-bin.000394' at 51254.
	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:937)
	... 3 more

配置文件中并没有地方设置 server_uuid/server_id, 为啥会出现这种情况?

给flink任务指定一个server-id就行了,每个任务不要重复

能否提供一下上面截图的文档地址

https://ververica.github.io/flink-cdc-connectors/master/content/connectors/mysql-cdc.html

这是需要对每张表单独设置?有很多表呢,调整起来费时费力。smt工具生成的flink cdc脚本是否可以支持添加上指定的server_id

试下这个 https://cdn-thirdparty.starrocks.com/smt.tar.gz?r=1642077048
下载后,在 [table-rule.x]中加入
flink.cdc.server-id = xxxx
生成的表会依据上面这个值自增server-id

1赞