0

I received this error when I ran the kafka container on docker.

Thereafter, I gave the following commands:

  1. docker exec -it /bin/sh #This starts the kafka container in interactive mode
  2. cd /opt/kafka
  3. ./bin/kafka-server-start.sh config/server.properties

I came across the solution to delete the folder which solved the issue for many, as stated here:

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

However, when I try this, it forces the container to stop. Also, I cannot find any .lock file inside the folder.

Kindly help me with this!

Yash
  • 3
  • 3

1 Answers1

0

Not clear what container you're actually using, but all kafka images run the same command as their entrypoint, which keeps them running.

Besides, the error says nothing about the /tmp folder and docker container file systems are ephemeral, so if you are not using volumes/mounts, then simply restarting the container would clear the error

All in all, you shouldn't start a new broker process manually

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • I am using wurstmeister/kafka.Oh okay, I thought to check its connection like I did with zookeeper. However, now when I scale up I get error saying ”task: none zero exit”. I am using rocker swarm and don't get this completely as I'm still learning. – Yash Oct 29 '20 at 09:18
  • Its not possible to scale the container because ports and the broker id must be different on new kafka brokers. You can read the wiki for that container to see how to create a cluster, but multiple brokers on the same machine doesn't improve performance or resiliency – OneCricketeer Oct 29 '20 at 15:03