mysql-canal-rabbitmq 安装部署教程 (5)

mysql-canal-rabbitmq 安装部署教程

参考: https://github.com/alibaba/canal/wiki/Canal-Kafka-RocketMQ-QuickStart?tdsourcetag=s_pctim_aiomsg

1.6. 问题处理

windows 下执行 startup.bat 启动 canal 时, 出现如下异常

Failed to instantiate [ch.qos.logback.classic.LoggerContext] Reported exception: ch.qos.logback.core.LogbackException: Unexpected filename extension of file [file:/D:/env/green/canal/conf/]. Should be either .groovy or .xml at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:79) at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152) at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85) at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:141) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304) at com.alibaba.otter.canal.deployer.CanalLauncher.<clinit>(CanalLauncher.java:29)

解决方法:
将 startup.bat 里的一下这行代码注释打开
@rem set logback_configurationFile=%conf_dir%\logback.xml

注, 新版 1.1.5 不存在该问题, 1.1.5这个文件中的这一行是没有注释掉的.

1.1.5新版本 canal-admin 启动时出现如下异常:

2020-04-10 18:55:40.406 [main] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization. java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

解决方法

spring.datasource.url 配置的 mysql 连接地址后面加上参数 &serverTimezone=UTC

Instance 日志里出现异常 errno = 1236, sqlstate = HY000 errmsg = log event entry exceeded max_allowed_packet;

2020-04-13 13:06:09.507 [destination = example3 , address = /192.168.2.108:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:example3[java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'mysql-5.7' at 671745, the last event read from 'D:\env\mysql-5.7' at 673181, the last byte read from 'D:\env\mysql-5.7' at 673200. at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:235) at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:265) at java.lang.Thread.run(Unknown Source) ]

解决方法

删除 canal/conf 下对应实例里的 meta.dat 文件, 让 canal-admin 自动再生成即可;

1.7. 参考资料

canal(基于 mysql 数据库 binlog 的增量订阅和消费)

Canal Admin 搭建 Canal 集群以及体验

canal 整合RabbitMQ

canal系列—配置文件介绍

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zydyzf.html