Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Topic creation error Kafka on Windows 7

After multiple re-tries and changing the bat files, I have finally succeeded in running Kafka and Zookeeper in Windows 7. This is a 32-bit machine running Java 7. Unfortunately though, I am not able to create a topic. I tried using the tutorial here: http://janschulte.wordpress.com/2013/10/13/apache-kafka-0-8-on-windows/

I executed the command:

C:\Cambria\kafka_2.8.0-0.8.0>bin\kafka-create-topic.bat --zookeeper localhost:2181 --replica 1 --partition 1 --topic topic

and end up with the following error:

Exception in thread "main" joptsimple.UnrecognizedOptionException: 'û' is not a recognized option
    at joptsimple.OptionException.unrecognizedOption(OptionException.java:89)
    at joptsimple.OptionParser.validateOptionCharacters(OptionParser.java:586)
    at joptsimple.OptionParser.handleShortOptionCluster(OptionParser.java:511)
    at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:506)
    at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59)
    at joptsimple.OptionParser.parse(OptionParser.java:433)
    at kafka.admin.CreateTopicCommand$.main(CreateTopicCommand.scala:56)
    at kafka.admin.CreateTopicCommand.main(CreateTopicCommand.scala)

All the classpath entries are proper and the requisite JAR files are also present. Am not sure what the issue is. Can someone help me on this?

P.S: I tried this with Cygwin and am encountering the Class Not Found error although the classpath is being properly set.

like image 302
Aparajith Avatar asked Feb 13 '14 23:02

Aparajith


2 Answers

For people who just started to play with kafka and encountered this problem (but on Unix machine), this is due to the outdated tutorial you are following.

In the latest version, you have to use

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

to create topic.

like image 177
Salvador Dali Avatar answered Nov 11 '22 22:11

Salvador Dali


run bin\kafka-create-topic.bat to see available options then for example you will see broker-list and all required parameters.

like image 21
dogukan sonmez Avatar answered Nov 11 '22 21:11

dogukan sonmez