I have windows environment and my own set of kafka and zookeeper running. To use custom objects, I started to use Avro. But I needed to get the registry started. Downloaded Confluent platform and ran this:
$ ./bin/schema-registry-start ./etc/schema-registry/schema-registry.properties
/c/Confluent/confluent-3.0.0-2.11/confluent-3.0.0/bin/schema-registry-run-class: line 103: C:\Program: No such file or directory
Then I see this on the installation page:
"Confluent does not currently support Windows. Windows users can download and use the zip and tar archives, but will have to run the jar files directly rather than use the wrapper scripts in the bin/ directory."
I was wondering how do I go about starting confluent schema registry in Windows environment ?
Looked at contents of scripts and it is difficult to decipher.
Thanks
Someone has created Windows .bat files as Ewen Cheslack-Postava suggests
https://github.com/renukaradhya/confluentplatform/tree/master/bin/windows
I saved
schema-registry-run-class.bat
andschema-registry-start.bat
into my\confluent\bin\windows
directory and then was able to run Schema Registry withC:\confluent\bin\windows\schema-registry-start.bat C:\confluent\etc\ schema-registry\schema-registry.properties
At the moment Confluent Platform does not ship with any scripts for Windows. However, you can write your own if you're comfortable with running Java applications. The
schema-registry-server-start
script (and theschema-registry-run-class
script it depends on) do things like handle-daemon
mode, set Java memory options, setup default log configuration, and more, but ultimately the key piece is that they execute Java withio.confluent.kafka.schemaregistry.rest.SchemaRegistryMain
as the main method. You might also find thekafka-run-class.bat
from Kafka as a useful base: https://github.com/apache/kafka/blob/trunk/bin/windows/kafka-run-class.batI've had success running the confluent tools from cmd.exe using cygwin.
The issue is likely the presence of spaces in the JAVA_HOME environment setting for your Windows environment (as evidenced by the error message of "C:\Program" rather than "C:\Program Files..." .
You can determine the EXACT syntax of the final java invocation to launch schema_registry by adding replacing the last "exec" in the schema-registry-run-class script with the word "echo". You'll see the rather convoluted command
That command boils down to "java [core-java-opts] [java-defines] -cp [classpath] io.confluent.kafka.schemaregistry.rest.SchemaRegistryMain
If you replace the "/opt/confluent" references with the actual location of your Confluent install, I suspect you'll have much better luck.
NOTE: I prefer to install Java on windows to a customer location (eg "C:\java8", since many standard scripts will have problems with C:\Program Files deployment location.