mysql mongodb binlog_kkbinlog

1 概述

mysql、MongoDB数据变动监听分发

本项目意在简化监听mysql、MongoDB数据库的不同表的各种数据变动

项目依赖redis,mysql

使用场景:刷新缓存、异构系统...

8404b5bf83d592d3118cc0f4352eb4c9.png

2 使用方式

从bin-log-distributor-app到client数据分发方式的默认实现为redis,如果要开发基于其他的比如mq,只需要分别实现bin-log-distributor-pub下的DataPublisher接口与bin-log-distributor-client下的即可

2.1 服务端

服务端是项目中bin-log-distributor-app模块,在mysql-binlog-connector-java基础上提供了监听mysql数据库二进制日志并进行分发的功能

2.1.1 参考配置

# redis地址

spring.redisson.address=redis://192.168.1.204:6379

# mysql日志同步账户,

binaryLog.host = 192.168.1.204

binaryLog.port = 3306

binaryLog.username = aa

binaryLog.password = aa

binaryLog.serverId = 1

# 读取列名,进行映射

spring.datasource.url = jdbc:mysql://${binaryLog.host}:${binaryLog.port}/mysql?autoReconnect=true&useUnicode=true&characterEncoding=utf-8

spring.datasource.username = ${binaryLog.username}

spring.datasource.password = ${binaryLog.password}

spring.datasource.driverClassName = com.mysql.jdbc.Driver

# rabbitmq连接相关信息(如果只有redis客户端可以不需要使用)

spring.rabbit.host = 192.168.1.204

spring.rabbit.port = 5672

spring.rabbit.username = aa

spring.rabbit.password = aa

spring.rabbit.virtualHost = /binlog

2.1.2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值