首页 > 解决方案 > Confluent 3.3 无法使用 kafka-avro-console-producer 在本地连接到模式注册表

问题描述

下载confluent开源3.3后在命令行做一个简单的实验:

confluent start - 启动所有服务而没有任何可见的错误:

confluent-3.3.0%   confluent start
Starting zookeeper
zookeeper is [UP]
Starting kafka
kafka is [UP]
Starting schema-registry
schema-registry is [UP]
Starting kafka-rest
kafka-rest is [UP]
Starting connect
connect is [UP]

使用 avro 控制台生产者发送消息,并查看到 localhost:8081 的连接错误,默认模式注册表端口:

confluent-3.3.0%   bin/kafka-avro-console-producer --broker-list localhost:9092 --topic test --property value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'
{"f1": "value1"}
[2018-06-28 12:22:47,827] ERROR Failed to send HTTP request to endpoint: http://localhost:8081/subjects/test-value/versions (io.confluent.kafka.schemaregistry.client.rest.RestService:156)
java.net.ConnectException: Connection refused

以上来自融合平台文档https://docs.confluent.io/3.3.0/quickstart.html。任何关于成功连接到模式注册表可能需要什么其他配置的想法表示赞赏。

标签: apache-kafkaconfluent-platformconfluent-schema-registry

解决方案


发布对我有用的东西,因为我已经看到许多其他类似问题的未回答问题 - 可悲的是,重新启动我的笔记本电脑是诀窍。

schema-registry在 Mac 上,您可以使用 Network Utility --> Port Scan 来验证默认端口上是否正在运行任何东西8081

它显示为sunproxyadmin

在重新启动之前,该端口没有显示任何内容,即使有时将confluent status模式注册表报告为“UP”。


推荐阅读