我测试了apacheflume将文件从本地传输到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
只能运行一个Flume。两个以上呢?
2条答案
按热度按时间yhuiod9q1#
为您需要的内容添加多个源,但将它们配置为使用同一个通道-然后将使用同一个源。所以有点像(注意这个片段是不完整的):
ki1q1bka2#
对两个源使用同一个通道并不是好的做法,您可以很容易地从该通道的内存(对于memorychannel)中取出,在这种情况下。最好对每个源使用一个通道(对于同一个代理)
然后将源r1链接到通道c1,将源r2链接到通道c2