YAFRA icon indicating copy to clipboard operation
YAFRA copied to clipboard

Kafka does not start correct

Open fritterhoff opened this issue 4 years ago • 4 comments

In some cases the kafka container does not startup correctly so the services are unable to publish/... their data.

An indicator for that situation seems to be the fact that kafka starts a new broker with id != 1001 on the inital start and the services run into a timeout.

At the moment the following workaround seems to fix the problem:

  • Stopping kafka
  • Getting the implicit created docker volume by running docker volume kafka and note the volume id
  • Executing a docker-compose down kafka
  • Deleting the volume by the id

At the moment this issue seems to affect Windows 10 + Docker and Debian 10 + Docker

fritterhoff avatar Jul 13 '21 10:07 fritterhoff

What steps do you took to get to this point?

DerAlexmeister avatar Jul 13 '21 10:07 DerAlexmeister

The Issue is not reproducible with 100% but it seems like that stopping the kafka container fails sometimes. On the next startup some "fragments" from the previous execution obviously cause the issues.

fritterhoff avatar Jul 13 '21 10:07 fritterhoff

Ah okay. Seems like, I figured out whats the problem. If you change anything on the kafka container, docker-compose recreates the container. That causes creating a new broker and this broker seems to be useless.

So after changing anything on the docker-compose configuration of kafka you must delete the old container including the volume.

So the steps to reproduce:

  1. Start kafka
  2. Stop kafka
  3. Change config (e.g. IP,...)
  4. Start kafka again
  5. Kafka will propably be broken even if you revert the changes in step 3

fritterhoff avatar Jul 13 '21 11:07 fritterhoff

Workaround:

  1. Stop all container
  2. Run sudo docker system prune (Only Linux/Unix) :)
  3. Restart Zookeeper
  4. Restart Kafka
  5. Restart YAFRA
  6. Working?

DerAlexmeister avatar Jul 13 '21 15:07 DerAlexmeister