apache-kafka - 使用远程 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");
解决方案
推荐阅读
- excel - VBA循环通过图表设置图表类型(xlLine),系列重量,系列颜色,图表图例(向下),图表高度和宽度
- python - 仅在按下按钮时播放 OpenCV 视频 TKinter
- android - Flutter 材质抽屉导航到页面
- html - 无法滚动菜单 - 菜单“后面”的内容滚动
- node-config - node-config 始终返回默认设置
- vuetify.js - 我可以全局使 v-input 选择控件在选择时使用强调色吗?
- c# - 请求令牌时跳过代码执行
- mysql - 获取多个订单产品单位的计数器
- java - 在 Postman 中记录没有 Content-Type 的 Spring 中的请求和响应(包括正文)
- python - ValueError:操作参数必须是 str - Python SQLite