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

上一篇:《Algorithms 4th Edition》读书笔记——2.4 优先队列(priority queue)-Ⅲ


下一篇:[LeetCode] 92. Reverse Linked List II 反向链表II