我使用brew在我的机器上安装了kafka。
brew install kafka
我打开了以下文件
/usr/local/etc/kafka/server.properties
默认情况下,kafka经纪人在9092上运行。但在我的情况下,这个端口已被弹性搜索占用。
所以我在这个文件中做了以下条目
listeners=PLAINTEXT://abhisheks-mini:9093
现在我使用brew services restart kafka
但现在如果我尝试
./kafka-topics.sh --create --zookeeper localhost:2181 --partitions 1 --replication-factor 1 --topic test
我收到错误
Error while executing topic command : replication factor: 1 larger than available brokers: 0
[2017-09-30 12:39:18,076] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: replication factor: 1 larger than available brokers: 0
(kafka.admin.TopicCommand$)
我认为这是因为我更改了端口,实用程序不知道新端口。
答案 0 :(得分:2)
目前kafka-topics.sh
只与动物园管理员交谈,据ZK说,你没有经纪人在运作。
我建议您检查代理日志(/usr/local/var/log/kafka
)以查看启动失败的原因。
此外,如果您只想更改端口,则不需要提供主机名/ IP,您只需要:
listeners=PLAINTEXT://:9093