【发布时间】:2014-07-20 04:42:38
【问题描述】:
如何使用 Flume 将一组 csv 文件从本地目录复制到 HDFS?我尝试使用假脱机目录作为我的源,但未能复制。然后我使用以下水槽配置来得到我的结果:
agent1.sources = tail
agent1.channels = MemoryChannel-2
agent1.sinks = HDFS
agent1.sources.tail.type = exec
agent1.sources.tail.command = tail -F /home/cloudera/runs/*
agent1.sources.tail.channels = MemoryChannel-2
agent1.sinks.HDFS.channel = MemoryChannel-2
agent1.sinks.HDFS.type = hdfs
agent1.sinks.HDFS.hdfs.path = hdfs://localhost:8020/user/cloudera/runs
agent1.sinks.HDFS.hdfs.file.Type = DataStream
agent1.channels.MemoryChannel-2.type = memory
我将文件复制到 hdfs,但它们包含特殊字符,对我没有用处。我的本地目录是 /home/cloudera/runs,我的 HDFS 目标目录是 /user/cloudera/runs。
【问题讨论】:
-
文件名以 Runs_Opposition_YYYY 格式命名(例如 Runs_Opposition_2000.csv)。他们有什么方法可以定期将这些文件名中附有年份的文件复制到 HDFS?