You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by 董建 <62...@163.com> on 2021/06/03 11:14:42 UTC

mysql主从切换导致通过flink mysql-cdc消费binlog 点位出错

由于各种原因,dba进行了数据库主从切换。
目前我采用flink mysql-cdc采集binlog,但是数据库主从切换后,导致binlog的pos不一致。
flink 程序会自动重启,在经过配置的重启策略后就会挂掉,日志打印
org.apache.kafka.connect.errors.ConnectException: The connector is trying to read binlog starting at GTIDs 3fa7d5bb-65f3-11eb-9413-b0262879b560:1-730774004 and binlog file 'mysql-bin.000650', pos=521310219, skipping 2 events plus 1 rows, but this is no longer available on the server. Reconfigure the connector to use a snapshot when needed.


由于pos=521310219在新的数据库服务器上位置不对,flink最后一次自动保存的checkpoint已经存储了pos=521310219,导致通过flink -s  的方式无法接着继续消费,并且job无法成功启动。
不知道大家有什么好的办法解决这个问题?