我有本地MYSQL,要同步到云MYSQL上, 本地MYSQL与云MYSQL不能相互访问(本地没外网IP,云MYSQL不暴露外网访问) 如何使用 canal.deployer > RocketMQ > canal.adapter 进行同步呢?或是还有其它方案? 因为cannal.adapter无法直接访问 srcDataSources 的mysql,注释掉了srcDataSources 想从RocketMQ 获取
配置文件如下 :
server: port: 8081 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 default-property-inclusion: non_null
canal.conf: mode: rocketMQ #tcp # kafka rocketMQ mqServers: 192.168.3.147:9006 #or rocketmq flatMessage: true batchSize: 500 syncBatchSize: 1000 retries: 0 timeout: accessKey: secretKey:
canalAdapters:
instance: example # canal instance Name or mq topic name groups: groupId: g1 outerAdapters: name: rdb key: mysql1 properties: jdbc.driverClassName: com.mysql.jdbc.Driver jdbc.url: jdbc:mysql://192.168.1.72:3306/test_db?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&allowPublicKeyRetrieval=true jdbc.username: root jdbc.password: 123456 如上配置,canal.adapter不会消费RocketMQ的消息,cannal.adapter已经发送到RocketMQ
原提问者GitHub用户CosmoYhh
其实漏配置了conf/rdb/mytest_user.yml 如果两边配置完全一样就使用
dataSourceKey: defaultDS destination: example groupId: g1 outerAdapterKey: mysql1 concurrent: true dbMapping: mirrorDb: true
如果不一样可以做个性化列映射配置。
原回答者GitHub用户agappleCosmoYhh
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。