解决Maxwell报错RuntimeException: Couldn‘t find database xxx

当在Maxwell未运行时修改MySQL数据库导致报错java.lang.RuntimeException:Couldntfinddatabaserealtime_datahouse,可以通过删除Maxwell元数据,重建数据库,重启Maxwell并检查进程来解决。步骤包括删除maxwell库,重建,启动Maxwell,确认元数据生成,并检查Maxwell进程状态。
摘要由CSDN通过智能技术生成

1、报错信息

java.lang.RuntimeException: Couldn't find database realtime_datahouse
        at com.zendesk.maxwell.replication.TableCache.processEvent(TableCache.java:26)
        at com.zendesk.maxwell.replication.BinlogConnectorReplicator.getTransactionRows(BinlogConnectorReplicator.java:502)
        at com.zendesk.maxwell.replication.BinlogConnectorReplicator.getRow(BinlogConnectorReplicator.java:626)
        at com.zendesk.maxwell.replication.BinlogConnectorReplicator.work(BinlogConnectorReplicator.java:178)
        at com.zendesk.maxwell.util.RunLoopProcess.runLoop(RunLoopProcess.java:34)
        at com.zendesk.maxwell.Maxwell.startInner(Maxwell.java:255)
        at com.zendesk.maxwell.Maxwell.start(Maxwell.java:183)
        at com.zendesk.maxwell.Maxwell.main(Maxwell.java:286)
2854 [INFO] TaskManager: Stopped all tasks

之所以出现这个报错是因为你在Maxwell没有启动的时候,进行了MySQL数据库的更改,此时binlog发生了变化,Maxwell没有接收到,当你再次启动Maxwell的时候,Maxwell就会报错。

2、解决

2.1 删除Maxwell的元数据

drop database maxwell;

2.2 重建库

create database maxwell;

2.3 启动maxwell,重新生成元数据

/opt/module/maxwell/bin/maxwell --config /opt/module/maxwell/config.properties --daemon

2.4 查看maxwell库中是否重新生成了元数据

mysql> use maxwell;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-------------------+
| Tables_in_maxwell |
+-------------------+
| bootstrap         |
| columns           |
| databases         |
| heartbeats        |
| positions         |
| schemas           |
| tables            |
+-------------------+

2.5 查看Linux上maxwell进程是否存在

[root@hadoop102 logs]# jps
5125 Maxwell
2440 Kafka
2379 QuorumPeerMain
2941 Application
5358 Jps
[root@hadoop102 logs]#

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值