apache avro可以写入网络吗?

v440hwme  于 2021-06-03  发布在  Flume
关注(0)|答案(1)|浏览(293)

我正在尝试写大量的日志到hdfs。为此,我使用Flume与hdfs作为Flume和avro作为源。我需要做的是通过网络使用avro将日志序列化到flume中。Flume的来源配置为:

a1.sources = r1
a1.channels = c1
a1.sources.r1.type = avro
a1.sources.r1.channels = c1
a1.sources.r1.bind = 0.0.0.0
a1.sources.r1.port = 4141

编辑:固定代码块

tf7tbtn2

tf7tbtn21#

使用flume的rpcclient:

RpcClient client = RpcClientFactory.getDefaultInstance(host, 4141);
client.append(EventBuilder.withBody(message));
client.close();

相关问题