【 使用环境 】测试环境
【 OB or 其他组件 】
【 使用版本 】oceanbase-all-in-one-4.2.1_BP9_HF1,obbinlog-ce-4.0.1-1.el7.x86_64
【问题描述】使用 OceanBase Binlog 获取oceanbase 的binlog日志,用flink cdc解析binlog,获取历史数据没问题,读binlog的时候报错
flink cdc脚本:
PRIMARY KEY(ORDER_ID) NOT ENFORCED
) WITH (
‘connector’ = ‘mysql-cdc’,
‘hostname’ = ‘10.26.45.187’,
‘port’ = ‘2883’,
‘username’ = ‘root@ubmp’,
‘password’ = ‘Yfgs!QC/pr{5T6c%s+VdAoF,’,
‘database-name’ = ‘ubmpdb’,
‘table-name’ = ‘od_order_info’
);
7bd10cd4bb20_cbc357ccb763df2852fee8c4fc7d55f2_0_2) switched from RUNNING to FAILED on localhost:47683-137b88 @ k8s01-dev.com (dataPort=52961).
java.lang.RuntimeException: One or more fetchers have encountered exception
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcherManager.checkErrors(SplitFetcherManager.java:263) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.SourceReaderBase.getNextFetch(SourceReaderBase.java:185) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.SourceReaderBase.pollNext(SourceReaderBase.java:147) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.api.operators.SourceOperator.emitNext(SourceOperator.java:419) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.io.StreamTaskSourceInput.emitNext(StreamTaskSourceInput.java:68) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:562) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:231) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:858) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:807) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:953) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:932) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:746) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:562) ~[flink-dist-1.18.1.jar:1.18.1]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_202]
Caused by: java.lang.RuntimeException: SplitFetcher thread 0 received unexpected exception while polling the records
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:168) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.run(SplitFetcher.java:117) ~[flink-connector-files-1.18.1.jar:1.18.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_202]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_202]
… 1 more
Caused by: io.debezium.DebeziumException: Unexpected error while connecting to MySQL and looking at GTID mode:
at io.debezium.connector.mysql.MySqlConnection.subtractGtidSet(MySqlConnection.java:311) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.checkGtidSet(StatefulTaskContext.java:255) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.isBinlogAvailable(StatefulTaskContext.java:213) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.loadStartingOffsetState(StatefulTaskContext.java:200) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.configure(StatefulTaskContext.java:127) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.reader.BinlogSplitReader.submitSplit(BinlogSplitReader.java:107) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.reader.BinlogSplitReader.submitSplit(BinlogSplitReader.java:75) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.source.reader.MySqlSplitReader.pollSplitRecords(MySqlSplitReader.java:116) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.source.reader.MySqlSplitReader.fetch(MySqlSplitReader.java:87) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at org.apache.flink.connector.base.source.reader.fetcher.FetchTask.run(FetchTask.java:58) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:165) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.run(SplitFetcher.java:117) ~[flink-connector-files-1.18.1.jar:1.18.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_202]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_202]
… 1 more
Caused by: java.sql.SQLSyntaxErrorException: FUNCTION GTID_SUBTRACT does not exist