报错:The db history topic or its content is fully or partially missing. Please check database history topic configuration and re-execute the snapshot.
使用flink-cdc-3.2.1实时同步sqlserver2019数据库到mysql8,SqlServer数据库是一个运行很久的数据库,数据库名称中包含特殊字符减号,同步作业报错。
我们在这个SqlServer上新建的数据库,数据库名称中没有特殊字符,同步作业可以正常实时同步。
出现这样问题,是什么原因,怎么解决?
下边是报错的flinksql:
CREATE TABLE t5(
uuid string ,
product_name string,
weight_date string,
car_no string,
consign_unit string,
gross_weight_id string,
PRIMARY KEY (uuid) NOT ENFORCED
)WITH(
'connector' = 'sqlserver-cdc',
'hostname' = '10.6.1.34',
'port' = '1433',
'username' = 'sa',
'password' = 'fsjldb',
'database-name' = 'db-web-pound',
'table-name' = 'dbo.db_measure_infos_20250305',
'server-time-zone'='Asia/Shanghai'
);
CREATE TABLE t6(
uuid string ,
weight_date string,
weight_time string,
PRIMARY KEY (uuid) NOT ENFORCED
)WITH(
'connector' = 'sqlserver-cdc',
'hostname' = '10.6.1.34',
'port' = '1433',
'username' = 'sa',
'password' = 'fsjldb',
'database-name' = 'db-web-pound',
'table-name' = 'dbo.db_weight_infos_20250305',
'server-time-zone'='Asia/Shanghai'
);
CREATE TABLE tt5(
id string,
weight_date string,
material_type string,
vehicles_license string,
dispatcher string,
one_test_time timestamp(3),
PRIMARY KEY (id) NOT ENFORCED
)WITH(
'connector' = 'jdbc',
'driver' = 'com.mysql.cj.jdbc.Driver',
'url' = 'jdbc:mysql://10.6.1.82:3306/logistics',
'table-name' = 'db_weight_one_real_time',
'username' = 'furnace',
'password' = 'furnace'
);
insert into tt5(id,weight_date,material_type,vehicles_license,dispatcher,one_test_time)
select
t5.uuid
,t5.weight_date
,t5.product_name
,t5.car_no
,t5.consign_unit
,TO_TIMESTAMP(CONCAT(t6.weight_date, ' ', t6.weight_time),'yyyy-MM-dd HH:mm:ss.SSS')
FROM t5
LEFT JOIN t6 ON t5.gross_weight_id = t6.uuid;
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。