0

I was installing kafka in Quickstart Cloudera VM using following link

but when i am running below command

kafka-topics --zookeeper quickstart.cloudera:2181 --create --topic test --partitions 1 --replication-factor 1

I am getting following error

19/09/21 11:28:36 INFO zookeeper.ClientCnxn: Session establishment complete on server quickstart.cloudera/10.0.2.15:2181, sessionid = 0x16d54d21037009d, negotiated timeout = 30000
19/09/21 11:28:38 INFO zookeeper.ZooKeeperClient: [ZooKeeperClient] Connected.
Error while executing topic command : Replication factor: 1 larger than available brokers: 0.
19/09/21 11:28:40 ERROR admin.TopicCommand$: org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 1 larger than available brokers: 0.

I tried to resolve this issue from here. but when running below command

bin/zookeeper-server-start.sh config/zookeeper.properties

but getting error.

19/09/21 11:54:42 ERROR quorum.QuorumPeerMain: Invalid config, exiting abnormally
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing config/zookeeper.properties
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:131)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:106)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
Caused by: java.lang.IllegalArgumentException: config/zookeeper.properties file is missing
at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:115)
... 2 more
Invalid config, exiting abnormally

Any lead is appreciated.

Actually I want to connect kafka to spark. If there is another way to do it. that is also fine.

Ayush Goyal
  • 415
  • 4
  • 23
  • 1
    1) `config/zookeeper.properties file is missing` ... What files are there in the config folder? 2) Seems like Kafka isn't running. How did you start it? 3) Do you really need a VM? Spark, Kafka, and Zookeeper all work outside of one – OneCricketeer Sep 22 '19 at 00:50
  • __cloudera_generation__, __cloudera_metadata__, kafka-client.conf, tools-log4j.properties – Ayush Goyal Sep 22 '19 at 09:47
  • above files are present. I installed it using parcels. So don't know why that file is not there. I need to work on HDFS, Spark, kafka. So I want to use this. I also tried to install kafka in my windows but getting same error. – Ayush Goyal Sep 22 '19 at 09:50
  • You should have all these files in the config folder https://github.com/apache/kafka/tree/trunk/config – OneCricketeer Sep 22 '19 at 13:58
  • How should i get these files there? Any suggestion? – Ayush Goyal Sep 22 '19 at 16:55
  • 1
    Copy the github file text into a file in the VM? – OneCricketeer Sep 22 '19 at 16:56
  • I try installing Kafka in windows also. In there config folder all these files are there but it is giving me below error – Ayush Goyal Sep 22 '19 at 16:56
  • Error while executing topic command : Replication factor: 1 larger than available brokers: 0. [2019-09-22 15:08:13,903] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 1 larger than available brokers: 0. (kafka.admin.TopicCommand$) – Ayush Goyal Sep 22 '19 at 16:57
  • 1
    Are you running `kafka-server-start` also? As far as I can tell, you've only started Zookeeper – OneCricketeer Sep 22 '19 at 20:08

1 Answers1

0

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

Your first error message says it all. It seems like you start only the zookeeper process, but not the broker. The error says that no brokers in the cluster.

Make sure that you start a Kafka broker with important broker configuration, make sure the zookeeper is the one you started!.

JengdiB
  • 56
  • 3