Error while executing topic command : Replication factor: 2 larger than available brokers: 0.

[root@hdp1 /mnt/software/maxwell-1.19.4]#kafka-topics.sh --zookeeper hdp1,hdp2,hdp3:2181 --create --topic maxwell --partitions 6 --replication-factor 2
Error while executing topic command : Replication factor: 2 larger than available brokers: 0.
[2019-01-18 04:18:09,809] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 2 larger than available brokers: 0.
(kafka.admin.TopicCommand$)

 

创建kafka的topic显示,存活的brokers为0

 

原因:

     没有在kafka目录下创建zookeeper ,指定myid

解决:

   cd kafka_2.11-1.1.0

  mkdir zookeeper
  cd zookeeper
  touch myid
  echo 0 > myid
重新启动kafka就ok

文章来自:https://www.cnblogs.com/QuestionsZhang/p/10288880.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3