Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql binlog方式同步,如何从最开始位置开始同步 #913

Closed
13668215435 opened this issue Jun 6, 2022 · 3 comments · Fixed by #917
Closed

mysql binlog方式同步,如何从最开始位置开始同步 #913

13668215435 opened this issue Jun 6, 2022 · 3 comments · Fixed by #917

Comments

@13668215435
Copy link

当同步mysql binlog日志时,sql方式无配置项指定从数据的最开始位置(即全量)开始同步;每次启动作业都是默认从最新的binlog位置开始同步,有无配置项控制binlog的消费位置?

binlog_mysql.sql:

CREATE TABLE source
(
id int,
name varchar(20),
sex varchar(10),
ts timestamp
) WITH (
'connector' = 'binlog-x'
,'username' = 'root'
,'password' = '123456'
,'cat' = 'insert,delete,update'
,'url' = 'jdbc:mysql://localhost:3306/test_cdc?useSSL=false'
,'host' = 'localhost'
,'port' = '3306'
,'table' = 'test_cdc.cdc_flink'
,'timestamp-format.standard' = 'SQL'
);

CREATE TABLE sink
(
id int,
name varchar(20),
sex varchar(10),
ts timestamp
) WITH (
'connector' = 'stream-x',
'print' = 'true'
);

insert into sink
select id,name,sex,ts
from source u;

@meng1222
Copy link
Contributor

meng1222 commented Jun 6, 2022

this is binlog document:https://github.com/DTStack/chunjun/blob/master/docs/connectors/binlog/binlog-source.md
Hope it helps you.

@13668215435
Copy link
Author

this is binlog document:https://github.com/DTStack/chunjun/blob/master/docs/connectors/binlog/binlog-source.md Hope it helps you.

thx,i mean sql mode,not json config mode,I didn't find the config options in sql mode,can you help me point it out?

@meng1222
Copy link
Contributor

meng1222 commented Jun 6, 2022

this is binlog document:https://github.com/DTStack/chunjun/blob/master/docs/connectors/binlog/binlog-source.md Hope it helps you.

thx,i mean sql mode,not json config mode,I didn't find the config options in sql mode,can you help me point it out?

yes,sql parameters are also included in this document.

yanghuaiGit pushed a commit to yanghuaiGit/chunjun that referenced this issue Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants