启动maxwell报错如下:
com.github.shyiko.mysql.binlog.network.ServerException: Could not find first log file name in binary log index file
at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:926) ~[mysql-binlog-connector-java-0.23.2.jar:0.23.2]
at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:595) ~[mysql-binlog-connector-java-0.23.2.jar:0.23.2]
at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:839) ~[mysql-binlog-connector-java-0.23.2.jar:0.23.2]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
15:28:08,666 INFO TaskManager - Stopping: com.zendesk.maxwell.schema.PositionStoreThread@447036b4
15:28:08,666 INFO TaskManager - Stopping: com.zendesk.maxwell.producer.MaxwellKafkaProducerWorker@4ab7d04a
15:28:08,668 INFO KafkaProducer - [Producer clientId=producer-1] Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.
15:28:08,671 INFO TaskManager - Stopping: com.zendesk.maxwell.bootstrap.BootstrapController@36a138c9
15:28:08,671 INFO TaskManager - Stopping: com.zendesk.maxwell.replication.BinlogConnectorReplicator@6ba5253e
15:28:08,671 ERROR Maxwell - Maxwell couldn't find the requested binlog, exiting...
15:28:10,118 INFO TaskManager - Stopped all tasks
1、先检测MySQL是否开启binlog
show variables like 'log_%';
出现如下结果说明binlog是正常开启的
2、检查Maxwell配置文件
vim /opt/module/maxwell-1.27.1 config.properties
检查Maxwell用户名、密码、及MySQL的连接是否正常
3、如果上述情况都正常,则考虑如下情况:
Maxwell 在 maxwell 库中维护了 binlog 的位移等信息,导致 maxwell 库中的记录与实际的binlog对不上,这时将报异常,这是可以手动修正binlog位移或者直接清空/删除 maxwell 库重建:
可以删除mysql里面 maxwell 数据库,重新创建;
或者清空maxwell 数据库 里面positions表