- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
所以我配置了 flume 以将我的 apache2 访问日志写入 hdfs ...并且我通过 flume 的日志发现所有配置都是正确的,但我不知道为什么它仍然不写入 hdfs .所以这是我的水槽配置文件
#agent and component of agent
search.sources = so
search.sinks = si
search.channels = sc
# Configure a channel that buffers events in memory:
search.channels.sc.type = memory
search.channels.sc.capacity = 20000
search.channels.sc.transactionCapacity = 100
# Configure the source:
search.sources.so.channels = sc
search.sources.so.type = exec
search.sources.so.command = tail -F /var/log/apache2/access.log
# Describe the sink:
search.sinks.si.channel = sc
search.sinks.si.type = hdfs
search.sinks.si.hdfs.path = hdfs://localhost:9000/flumelogs/
search.sinks.si.hdfs.writeFormat = Text
search.sinks.si.hdfs.fileType = DataStream
search.sinks.si.hdfs.rollSize=0
search.sinks.si.hdfs.rollCount = 10000
search.sinks.si.hdfs.batchSize=1000
search.sinks.si.rollInterval=1
这是我的水槽日志
14/12/18 17:47:56 INFO node.AbstractConfigurationProvider: Creating channels
14/12/18 17:47:56 INFO channel.DefaultChannelFactory: Creating instance of channel sc type memory
14/12/18 17:47:56 INFO node.AbstractConfigurationProvider: Created channel sc
14/12/18 17:47:56 INFO source.DefaultSourceFactory: Creating instance of source so, type exec
14/12/18 17:47:56 INFO sink.DefaultSinkFactory: Creating instance of sink: si, type: hdfs
14/12/18 17:47:56 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
14/12/18 17:47:56 INFO hdfs.HDFSEventSink: Hadoop Security enabled: false
14/12/18 17:47:56 INFO node.AbstractConfigurationProvider: Channel sc connected to [so, si]
14/12/18 17:47:56 INFO node.Application: Starting new configuration:{ sourceRunners:{so=EventDrivenSourceRunner: { source:org.apache.flume.source.ExecSource{name:so,state:IDLE} }} sinkRunners:{si=SinkRunner: { policy:org.apache.flume.sink.DefaultSinkProcessor@3de76481 counterGroup:{ name:null counters:{} } }} channels:{sc=org.apache.flume.channel.MemoryChannel{name: sc}} }
14/12/18 17:47:56 INFO node.Application: Starting Channel sc
14/12/18 17:47:56 INFO instrumentation.MonitoredCounterGroup: Monitored counter group for type: CHANNEL, name: sc: Successfully registered new MBean.
14/12/18 17:47:56 INFO instrumentation.MonitoredCounterGroup: Component type: CHANNEL, name: sc started
14/12/18 17:47:56 INFO node.Application: Starting Sink si
14/12/18 17:47:56 INFO node.Application: Starting Source so
14/12/18 17:47:56 INFO source.ExecSource: Exec source starting with command:tail -F /var/log/apache2/access.log
14/12/18 17:47:56 INFO instrumentation.MonitoredCounterGroup: Monitored counter group for type: SINK, name: si: Successfully registered new MBean.
14/12/18 17:47:56 INFO instrumentation.MonitoredCounterGroup: Component type: SINK, name: si started
14/12/18 17:47:56 INFO instrumentation.MonitoredCounterGroup: Monitored counter group for type: SOURCE, name: so: Successfully registered new MBean.
14/12/18 17:47:56 INFO instrumentation.MonitoredCounterGroup: Component type: SOURCE, name: so started
这是我用来启动flume的命令
flume-ng agent -n search -c conf -f ../conf/flume-conf-search
我在hdfs中有一个路径
hadoop fs -mkdir hdfs://localhost:9000/flumelogs
但我不知道为什么它不写入 hdfs..我可以看到 apache2 的访问日志..但是 flume 没有将它们发送到 hdfs/flumelogs 目录....请帮忙! !
最佳答案
我认为这不是权限问题,当 flume 刷新到 HDFS 时您会看到异常。这个问题有两个可能的原因:
1) 缓冲区中没有足够的数据,flume 认为它还没有刷新。您的接收器批量大小为 1000,您的 channel 容量为 20000。要验证这一点,CTRL -C 您的水槽进程,这将强制进程刷新到 HDFS。
2) 更可能的原因是您的 exec 源未正常运行。这可能是由于 tail 命令的路径问题。在命令中添加 tail 的完整路径,例如/bin/tail -F/var/log/apache2/access.log 或/usr/bin/tail -F/var/log/apache2/access.log(取决于您的系统)检查
which tail
正确的路径。
关于hadoop - Flume 不将日志写入 Hdfs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27546621/
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-topi
spooldir 选项用于流式传输特定目录的所有文件。完成整个目录读取后,作业将暂停/停止。但是,如果我想将新文件添加到同一目录中,会发生什么?? 我的要求是在任何新文件添加到该特定 spooldir
我正在尝试从/home/cloudera/Documents/flume/读取日志文件并使用 apache flume 将其写入 hdfs。我使用以下命令在 hdfs 中创建 flumeLogTest
我正在尝试使用 MemChannel 和 HDFS 处理一些 Twitter 关键字。但是,在控制台上的 HDFS 启动 状态后,flume-ng 没有显示进一步的进度。 这是/etc/flume-n
我正在尝试为flume-ng编写一个自定义接收器。我查看了现有的接收器和文档并对其进行了编码。但是,应该接收事件的“process()”方法总是以 null 结束。 我正在做 Event event
我正在测试 Flume NG (1.2.0) 以收集日志。 Flume收集日志文件flume_test.log的简单测试并将收集到的日志作为 sysout 打印到控制台。 conf/flume.con
我在 flume.con 文件中声明了一个 flume agent。来源是 RabbitMQ,尽管这不是很相关。问题是我需要从那里取出凭证到另一个文件。我看到这样做的方法是在 flume-env.sh
我有一个用例,我需要将文件从目录提取到 HDFS。作为 POC,我在 Flume 中使用了简单的目录假脱机,我在其中指定了源、接收器和 channel ,它工作正常。缺点是我必须为进入不同文件夹的多种
我正在使用 Flume 1.3.1 ng,我正在将文件从 spoolDir 传输到 HDFS Sink,并且我需要与输入文件相同的输出文件名称。例如,如果输入文件名为sample.gz,则输出也需要为
kafka_2.10-0.8.2.0 水槽1.6 这是我的水槽配置: a1.sources = r1 a1.sinks = k1 a1.channels = c1 a1
我正在使用以下配置详细信息使用 Flume 将 Twitter 提要推送到 HDFS,但在 Flume 事件 header 中获得预期时间戳,但它为空 twitter.conf TwitterAgen
我们将一个 150 mb 的 csv 文件复制到水槽的 spool 目录中,当它被加载到 hdfs 中时,该文件被拆分成更小的文件,例如 80 kb 的文件。有没有办法加载文件而不会使用水槽拆分成更小
我们将推文保存在目录顺序中,例如/user/flume/2016/06/28/13/FlumeData...。但每小时它会创建超过 100 个 FlumeData 文件。我更改了 TwitterAge
有大量关于在 CDH3 中以故障转移模式配置 Flume (0,9x) 节点的信息。 但是CDH4中Flume(1.x)配置的配置格式完全不同。如何在故障转移模式下配置 Flume 1.x (flum
我正在使用 cloudera CDH 4.4。当我运行 flume cmd 时 - "bin/flume-ng agent -n agentA -f conf/MultipleFlumes.prope
我在 CentOS(cloudera VM)中安装了 Flume 1.4.0-cdh4.7.0 我运行以下命令来启动水槽 Flume-ng agent -n agent-name -c conf -f
我正在尝试运行典型的 Flume 第一个示例来获取推文并使用 Apache FLume 将它们存储在 HDFS 中。 [Hadoop version 3.1.3; Apache Flume 1.9.0
我正在尝试使用 Flume 进行 Twitter 分析。为了从 twitter 获取推文,我在 flume.conf 文件中设置了所有必需的参数(consumerKey、consumerSecret、
我正在尝试使用 Flume 和 Hive 进行 Twitter 分析。为了从 twitter 获取推文,我在 flume.conf 文件中设置了所有必需的参数(consumerKey、consumer
我搭建了一个hadoop集群,其中一个是master-slave节点,另一个是slave。现在,我想建立一个水槽来获取主机上集群的所有日志。但是,当我尝试从 tarball 安装 flume 时,我总
我是一名优秀的程序员,十分优秀!