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]#