卡夫卡在重新启动时失去了所有主题 [英] kafka loses all topics on reboot

查看:26
本文介绍了卡夫卡在重新启动时失去了所有主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在虚拟机中试用Kafka(0.8.2.1),但遇到了麻烦:尽管在机器保持开机状态(即使我重新启动ZK/Kafka)时一切正常,但是如果我重新启动机器(在正常关闭ZK/Kafka之后),似乎所有Kafka主题都消失了.

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 machine (after gracefully shutting down ZK/Kafka) it seems all Kafka topics go lost.

我可能在这里缺少一些基本的东西,因为这可能不应该发生.可能是什么?

I'm probably missing something basic here, since this is probably not supposed to happen. What might it be?

cd /vagrant/kafka_2.11-0.8.2.1
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 10 --topic foo
bin/kafka-topics.sh --list --zookeeper localhost:2181
# foo
# ^C then resume ZooKeeper, Kafka, or both
bin/kafka-topics.sh --list --zookeeper localhost:2181
# foo
# ^C both, reboot machine, boot ZK/Kafka again
bin/kafka-topics.sh --list --zookeeper localhost:2181
# no topics

推荐答案

日志的默认位置看起来在/tmp目录中,该目录在重新启动后会被擦除.在配置中将该位置更改为更永久的位置.

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.

这篇关于卡夫卡在重新启动时失去了所有主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆