我的代码实现了通过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");