kafka loses all topics on reboot

前端 未结 3 682
余生分开走
余生分开走 2020-12-19 01:55

I\'m trying out Kafka (0.8.2.1) in a VM, but am having trouble with it: though everything is fine while the machine remains on (even if I restart ZK/Kafka), if I reboot the

相关标签:
3条回答
  • 2020-12-19 02:06

    Go to kafka installation folder > config> server.properties

    search for log.dirs in that file, change path from /tmp/logs to local directory. Restart kafka server and you will see topics created will be saved in that local folder we have changed in config file.

    0 讨论(0)
  • 2020-12-19 02:18

    This happens because the tmp folder get cleared out on reboot.

    To fix this issue, do the following.

    Go to you kafka installation directory and search for the file server.properties. You should see a section as below

    A comma separated list of directories under which to store log files
    log.dirs=/tmp/kafka-logs

    Change the logs.dir to something more local or a custom dir like this. log.dirs=/Users/xxx/yyy/software/confluent-5.3.1/mydata

    Reboot your kafka cluster for the changes to take effect. Reboot your system and you will see the Topics are still present.

    0 讨论(0)
  • 2020-12-19 02:19

    Looks like the default location for logs is in the /tmp directory which gets wiped on reboot. Change that location in the config to a more permanent location.

    0 讨论(0)
提交回复
热议问题