Skip to content

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

@liumengkai

Description

@liumengkai

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
}
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions