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

Binlog reader指定消费位置没有生效 #978

Closed
liumengkai opened this issue Jun 20, 2022 · 1 comment
Closed

Binlog reader指定消费位置没有生效 #978

liumengkai opened this issue Jun 20, 2022 · 1 comment

Comments

@liumengkai
Copy link
Contributor

liumengkai commented Jun 20, 2022

1.系统版本
os:mac 12.0.1
chunjun:直接从master上clone的

2.场景
使用binlogreader读取mysqlbinlog 然后使用stream print 打印在终端

mysql配置:
[mysqld]
//log_bin
//log-bin = mysql-bin #开启binlog
log_bin = mysql-bin
binlog-format = ROW #选择row模式
server_id = 109 #配置mysql replication需要定义,不能喝canal的slaveId重复
expire_logs_days = 30

3.问题
我在配置文件中配置了

"start" : {
            "journalName": "mysql-bin.000001"
          }

但是每次启动程序还是会从最新的开始消费,就是我这边mysql新的操作才会打印出来,是我的配置存在问题嘛?如果想要他从指定的文件和position开始消费应该如何配置呢?

下面是整体配置文件

{
"job" : {
"content" : [ {
"reader" : {
"parameter" : {
"schema" : "test",
"username" : "root",
"password" : "112233",
"cat" : "insert,delete,update",
"jdbcUrl" : "jdbc:mysql://localhost:3306/test?useSSL=false",
"host" : "localhost",
"port" : 3306,
"start" : {
"journalName": "mysql-bin.000001"
},
"table" : ["tbl_user_0"],
"splitUpdate" : true,
"pavingData" : true
},
"name" : "binlogreader"
},
"writer" : {
"parameter" : {
"print" : true
},
"name" : "streamwriter"
}
} ],
"setting" : {
"speed" : {
"bytes" : 0,
"channel" : 1
}
}
}
}

@liumengkai liumengkai changed the title Binlog reader指定其实消费位置没有生效 Binlog reader指定消费位置没有生效 Jun 20, 2022
@liumengkai
Copy link
Contributor Author

this is a bug, I will make a pull request

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

No branches or pull requests

1 participant