我在 Kubernetes 集群的容器中运行了 confluent kafka、zookeeper、schema-registry 和 ksql。Kafka、zookeeper 和模式注册表工作正常,可以创建主题并以 Avro 格式写入数据,但是当我尝试检查 ksql 并使用 curl 创建一些流时,例如:
curl -XPOST http://ksql-svc.someapp:8080/ksql -H "Content-Type: application/json" -d $'
{"ksql": "CREATE STREAM kawabanga_stream (log_id varchar, created_date varchar) WITH (kafka_topic = '\'kawabanga\'', value_format = '\'avro\'');","streamsProperties":{}}'
我得到错误:
[{"error":{"statementText":"CREATE STREAM kawabanga_stream (log_id varchar, created_date varchar) WITH (kafka_topic = 'kawabanga', value_format = 'avro');","errorMessage":{"message":"Avro schema file path should be set for avro topics.","stackTrace":["io.confluent.ksql.ddl.commands.RegisterTopicCommand.extractTopicSerDe(RegisterTopicCommand.java:75)","io.confluent.ksql.ddl.commands.RegisterTopicCommand.<init>
请在下面找到我的 ksql 服务器配置:
# cat /etc/ksql/ksqlserver.properties
bootstrap.servers=kafka-0.kafka-hs:9093,kafka-1.kafka-hs:9093,kafka-
2.kafka-hs:9093
schema.registry.host=schema-svc
schema.registry.port=8081
ksql.command.topic.suffix=commands
listeners=http://0.0.0.0:8080
我也尝试在没有 schema.registry 字符串的情况下启动服务器,但没有运气