[2021-08-01 23:37:01,332] ERROR [KafkaServer id=1] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.kafka.common.KafkaException: Failed to acquire lock on file .lock in /usr/local/var/lib/kafka-logs-1. A Kafka instance in another process or thread is using this directory.
解决方案
删除 /usr/local/var/lib/kafka-logs-1
ps -ef |grep kafka 杀掉进程
我这边 /usr/local/var/lib/kafka-logs-1 会重新自动生成,如果是其他路径,重新建立一份就好,启动正常。