Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache kafka: Failed to acquire lock on file .lock in tmp/kafka-logs

Tags:

apache-kafka

According to official kafka documentation after command bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic my-replicated-topic server throw error "Failed to acquire lock on file .lock in tmp/kafka-logs". How to fix it?

like image 406
Дмитрий Дорогонов Avatar asked May 18 '16 09:05

Дмитрий Дорогонов


2 Answers

just delete directory /tmp/kafka-logs and try again

like image 68
Fisher Avatar answered Nov 11 '22 14:11

Fisher


Remove the file .lock in /tmp/kafka-logs:

rm /tmp/kafka-logs/.lock.

That way you can keep any pre-existing logs.

like image 41
Bennett Buchanan Avatar answered Nov 11 '22 13:11

Bennett Buchanan