You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the data was finally queried, the incremental data could not be queried. During the query process of Flink, mysql was added and deleted, but the changed data was not successfully captured. Insert data, Flink Web Logs run log
最终查询数据时,并不能查询增量数据,在Flink 运行 该查询过程中,对mysql 进行增删,没有成功捕获变更数据。插入数据,Flink Web Logs 运行日志
2023-09-09 16:22:16,848 INFO org.apache.flink.runtime.source.coordinator.SourceCoordinator [] - Marking checkpoint 25 as completed for source Source: users_source_mysql[9].
2023-09-09 16:22:19,396 INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator [] - Triggering checkpoint 26 (type=CheckpointType{name='Checkpoint', sharingFilesStrategy=FORWARD_BACKWARD}) @ 1694247739395 for job 5962eee782a28935494f859ea08245a5.
2023-09-09 16:22:19,852 INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator [] - Completed checkpoint 26 for job 5962eee782a28935494f859ea08245a5 (3607 bytes, checkpointDuration=457 ms, finalizationTime=0 ms).
2023-09-09 16:22:19,856 INFO org.apache.flink.runtime.source.coordinator.SourceCoordinator [] - Marking checkpoint 26 as completed for source Source: users_source_mysql[9].
2023-09-09 16:22:22,394 INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator [] - Triggering checkpoint 27 (type=CheckpointType{name='Checkpoint', sharingFilesStrategy=FORWARD_BACKWARD}) @ 1694247742393 for job 5962eee782a28935494f859ea08245a5.
2023-09-09 16:22:22,835 INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator [] - Completed checkpoint 27 for job 5962eee782a28935494f859ea08245a5 (3607 bytes, checkpointDuration=441 ms, finalizationTime=1 ms).
2023-09-09 16:22:22,835 INFO org.apache.flink.runtime.source.coordinator.SourceCoordinator [] - Marking checkpoint 27 as completed for source Source: users_source_mysql[9].
Expect performance 期待表现
Flink SQL> select * from users_source_mysql;
op
id
name
birthday
ts
+
1
test1
time1
time1
+
2
test2
time2
Time2
Delete data in mysql
mysql>delete from users_source_mysql where id = 1;
Expect Result
op
id
name
birthday
ts
+
1
test1
time1
time1
+
2
test2
time2
time2
-
1
test1
time3
Time
However, our actual effect is that we cannot see our changed data records in real time during the initial query execution.
When the last query execution is closed and the same query statement is reopened, the result will become:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Enviroment 环境
Operating System : Mac OS
Mysql: 8.0.33
Java : zulu-8
hadoop: 3.2.2
flink: 1.16.1
Configuration 基本配置
Jar in
$FLINK_HOME\lib
Flink 所含外部lib包flink checkpoint location(位置)
hdfs://hostname:port/flink/checkpoints
mysql my.cnf setting 设置
mysql binlog test 测试
flink CDC query mysql Data 查询mysql数据
start Flink SQL
最终查询数据时,并不能查询增量数据,在Flink 运行 该查询过程中,对mysql 进行增删,没有成功捕获变更数据。插入数据,Flink Web Logs 运行日志
Expect performance 期待表现
Delete data in mysql
Expect Result
然而我们实际效果确实并不能实时在最开始的查询执行中看到我们的变更数据记录,
当新关闭上个查询执行,重新开启一个相同的查询语句,结果就会变成:
Beta Was this translation helpful? Give feedback.
All reactions