Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instance in another process or thread is using this directory.

时间:2022-05-08 22:57:14

1. 问题现象

  启动 kafka 时报错:Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instance in another process or thread is using this directory.

2. 解决方案

2.1 方案一

  删除 /tmp/kafka-logs 目录,然后重启 kafka;

2.2 方案二

  修改配置的日志文件目录

  在 config/server.properties 中修改 log.dirs 的参数值。

  Failed to acquire lock on file .lock in /tmp/kafka-logs. A Kafka instance in another process or thread is using this directory.