0

I am trying to test Zookeeper to Kraft migration on my machine that later needs to done on dev env. I have created ZK and kafka images using podman and started them. Now one step in the migration is to enable migration on Kraft controllers and then on the ZK based Kafka brokers.

So to enable migration we have to add this flag zookeeper.metadata.migration.enable=true to brokers under the server.properties file and then restart them for the migration to begin. To make the change I exec into the container open the files and added this flag and saved it, but as soon as I stop and start it again, the change that I did is not present.

Now for migration, changes to server.properties needs to be on both Kraft controller and ZK-based broker a few times during the whole migration process like this flag. So will I have to rebuild the image again and again after I make changes to the configs ? or is there a way to make the changes persistent upon container restart..

asked Apr 3, 2025 at 6:41
3
  • 1
    Where does the configuration file come from? docker exec has exactly the problem you describe here, that when the container is deleted and recreated any changes you make manually are lost. One typical approach is to bind-mount the configuration file from the host instead, so you can edit it normally and it will survive restarts, but you need a copy of it on the host to start with. Commented Apr 3, 2025 at 10:01
  • @DavidMaze so this file server.properties is already present and comes with kafka's source code. So as I understand, ig I could create this file on my local system and volume mount it in the container... and after this if i lets say change this flag from true to false and restart the container I could see the changes being reflected, right ? Commented Apr 3, 2025 at 11:57
  • @BloodFury check out the edited answer, option1 Commented Apr 3, 2025 at 18:09

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.