首页 > 解决方案 > 使用远程 Kafka schema_registry 时写入失败

问题描述

我的代码实现了通过 Schema_Registry 服务器将 Avro 数据写入 Kafka 代理。本地测试很好(I setup a local Broker and Schema_Registry server)。但是当我更改配置文件并使用远程 kafka 和 schema_registry 服务器时,由于 TimeoutException,写入失败。(but when I logged in the remote server and used Avro producer/consumer command line, it works good too. )

我是否需要在 Schema_Registry 端或客户端更改任何配置?

我的 schema_registry 服务器属性文件如下:

listeners=http://0.0.0.0:8081
kafkastore.connection.url=localhost:2181
kafkastore.topic=_schemas
debug=fals

我的生产者代码如下:

props.put("bootstrap.servers", "10.5.149.21:9092");//this is a remote ip
props.put("schema.registry.url","http://10.5.149.21:8081");

标签: apache-kafkaavroconfluent-schema-registry

解决方案


推荐阅读