"请问下flinkcdc 关于serverId有个疑惑,mysql source监听了三张表,并行度设置为4, 从日志里面可以看到:有4个MySqlStreamingChangeEventSource(其中有两个一样的),serverId都是0,
但是代码里面设置的是3556494-3556498,
2023-07-11 09:29:02,882 INFO io.debezium.connector.mysql.MySqlStreamingChangeEventSource [] - Connected to MySQL binlog at 192.168.200.120:3306, starting at MySqlOffsetContext [sourceInfoSchema=Schema{io.debezium.connector.mysql.Source:STRUCT}, sourceInfo=SourceInfo [currentGtid=null, currentBinlogFilename=mysql-bin.002899, currentBinlogPosition=964895431, currentRowNumber=0, serverId=0, sourceTime=null, threadId=-1, currentQuery=null, tableIds=[], databaseName=null], snapshotCompleted=false, transactionContext=TransactionContext [currentTransactionId=null, perTableEventCount={}, totalEventCount=0], restartGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835739, currentGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835739, restartBinlogFilename=mysql-bin.002899, restartBinlogPosition=964895431, restartRowsToSkip=0, restartEventsToSkip=0, currentEventLengthInBytes=0, inTransaction=false, transactionId=null, incrementalSnapshotContext =IncrementalSnapshotContext [windowOpened=false, chunkEndPosition=null, dataCollectionsToSnapshot=[], lastEventKeySent=null, maximumKey=null]]
2023-07-11 09:29:02,885 INFO io.debezium.connector.mysql.MySqlStreamingChangeEventSource [] - Connected to MySQL binlog at 192.168.200.120:3306, starting at MySqlOffsetContext [sourceInfoSchema=Schema{io.debezium.connector.mysql.Source:STRUCT}, sourceInfo=SourceInfo [currentGtid=null, currentBinlogFilename=mysql-bin.002899, currentBinlogPosition=964895431, currentRowNumber=0, serverId=0, sourceTime=null, threadId=-1, currentQuery=null, tableIds=[], databaseName=null], snapshotCompleted=false, transactionContext=TransactionContext [currentTransactionId=null, perTableEventCount={}, totalEventCount=0], restartGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835739, currentGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835739, restartBinlogFilename=mysql-bin.002899, restartBinlogPosition=964895431, restartRowsToSkip=0, restartEventsToSkip=0, currentEventLengthInBytes=0, inTransaction=false, transactionId=null, incrementalSnapshotContext =IncrementalSnapshotContext [windowOpened=false, chunkEndPosition=null, dataCollectionsToSnapshot=[], lastEventKeySent=null, maximumKey=null]]
2023-07-11 09:29:03,755 INFO io.debezium.connector.mysql.MySqlStreamingChangeEventSource [] - Connected to MySQL binlog at 192.168.200.120:3306, starting at MySqlOffsetContext [sourceInfoSchema=Schema{io.debezium.connector.mysql.Source:STRUCT}, sourceInfo=SourceInfo [currentGtid=null, currentBinlogFilename=mysql-bin.002899, currentBinlogPosition=965720087, currentRowNumber=0, serverId=0, sourceTime=null, threadId=-1, currentQuery=null, tableIds=[], databaseName=null], snapshotCompleted=false, transactionContext=TransactionContext [currentTransactionId=null, perTableEventCount={}, totalEventCount=0], restartGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835745, currentGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835745, restartBinlogFilename=mysql-bin.002899, restartBinlogPosition=965720087, restartRowsToSkip=0, restartEventsToSkip=0, currentEventLengthInBytes=0, inTransaction=false, transactionId=null, incrementalSnapshotContext =IncrementalSnapshotContext [windowOpened=false, chunkEndPosition=null, dataCollectionsToSnapshot=[], lastEventKeySent=null, maximumKey=null]]
2023-07-11 09:29:09,690 INFO io.debezium.connector.mysql.MySqlStreamingChangeEventSource [] - Connected to MySQL binlog at 192.168.200.120:3306, starting at MySqlOffsetContext [sourceInfoSchema=Schema{io.debezium.connector.mysql.Source:STRUCT}, sourceInfo=SourceInfo [currentGtid=null, currentBinlogFilename=mysql-bin.002899, currentBinlogPosition=928870543, currentRowNumber=0, serverId=0, sourceTime=null, threadId=-1, currentQuery=null, tableIds=[], databaseName=null], snapshotCompleted=false, transactionContext=TransactionContext [currentTransactionId=null, perTableEventCount={}, totalEventCount=0], restartGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835045, currentGtidSet=abf5f50b-8d7d-11ec-acf2-ae3da86f6eae:1-222835045, restartBinlogFilename=mysql-bin.002899, restartBinlogPosition=928870543, restartRowsToSkip=0, restartEventsToSkip=0, currentEventLengthInBytes=0, inTransaction=false, transactionId=null, incrementalSnapshotContext =IncrementalSnapshotContext [windowOpened=false, chunkEndPosition=null, dataCollectionsToSnapshot=[], lastEventKeySent=null, maximumKey=null]]"
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
在使用 Flink CDC 连接 MySQL 数据库时,需要指定一个 server-id 参数,以标识 CDC 连接器的唯一性。如果您在使用 Flink CDC 过程中遇到了 server-id 相关的问题,可能是由以下几个原因引起的:
server-id 参数重复:如果您在使用多个 Flink CDC 连接 MySQL 数据库时,多个连接器使用了相同的 server-id 参数,可能会导致冲突和错误。您需要确保每个连接器使用的 server-id 参数都是唯一的。
server-id 参数不正确:如果您在使用 Flink CDC 连接 MySQL 数据库时,指定的 server-id 参数不正确,可能会导致连接器无法正确读取和同步数据。您需要确保您指定的 server-id 参数与 MySQL 数据库的配置相匹配。
MySQL 服务器配置错误:如果您在使用 Flink CDC 连接 MySQL 数据库时,MySQL 服务器的配置不正确,可能会导致连接器无法正确读取和同步数据。您需要确保 MySQL 服务器的配置与 Flink CDC 的要求相匹配。
为了解决这些问题,您可以采取以下措施:
确保每个 Flink CDC 连接器使用唯一的 server-id 参数,您可以在配置文件中指定不同的 server-id 参数。
确保您指定的 server-
实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。