我测试了Apache Flume将文件从本地传输到HDFS。但是,如果源文件来自多个服务器(从不同服务器的本地文件传输到HDFS),我是否可以只运行一个Flume实例并将更多代理添加到flume-conf.properties中?
如果可以,如何在flume-conf.properties中编辑以下参数:
agent1.sources.spooldirSource1.spoolDir = ?(server1/path)
agent2.sources.spooldirSource2.spoolDir = ?(server2/path)还有,我怎样才能运行flume?
./flume-ng agent -n agent -c conf -f apache-flume-1.4.0-bin/conf/flume-conf.properties只能运行一个水槽。如果超过两个呢?
发布于 2013-10-09 23:46:09
为您需要的内容添加多个源,但将它们配置为使用相同的通道-这将使用相同的源。所以它类似于(注意这段代码是不完整的):
agent1.sources.spooldirSource1.spooldir = server1/path
agent1.sources.spooldirSource1.channel = myMemoryChannel
agent1.sources.spooldirSource2.spooldir = server2/path
agent1.sources.spooldirSource2.channel = myMemoryChannel发布于 2018-07-02 22:25:06
对于两个源使用相同的通道并不是很好的做法,你可以很容易地获得通道的outOfMemory (对于MemoryChannel),在这种情况下。最好为每个源使用一个通道(对于相同的代理)
a1.sources = r1 r2
a1.sinks = k1 k2
a1.channels = c1 c2然后,将源r1链接到通道c1,并将源r2链接到通道c2
https://stackoverflow.com/questions/19235654
复制相似问题