把Flume的Source设置为 Spooling directory source
把Flume的Source设置为 Spooling directory source,在设定的目录下放置需要读取的文件,一些文件在读取过程中会报错。
文件格式和报错如下:
实验一
读取汉子和“;"符号的TXT文档
会报一下错误
- 2015-11-06 22:16:02,386 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-2 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
- java.nio.charset.MalformedInputException: Input length = 1
- at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
- at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)
实验二
读取数字和”;“符号的TXT文档
报错
- 2015-11-06 22:22:49,012 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-3 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
- java.nio.charset.MalformedInputException: Input length = 1
- at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
- at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)
此报错与前面的报错相同。
实验三
读取数字和”回车符“的TXT文档
报错:
- 2015-11-06 22:28:06,889 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-7 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
- java.nio.charset.MalformedInputException: Input length = 1
- at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
- at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)
实验四
读取数字,字母,汉字组成的csv文件
报错:
- 2015-11-06 22:40:34,781 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-6 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
- java.nio.charset.MalformedInputException: Input length = 1
- at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
- at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)
- at org.apache.flume.serialization.LineDeserializer.readLine(LineDeserializer.java:133)
- at org.apache.flume.serialization.LineDeserializer.readEvent(LineDeserializer.java:71)
实验五
读取数字和汉字组成的TXT文件
报错:
- 2015-11-06 23:34:29,455 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:256)] FATAL: Spool Directory source r1: { spoolDir: /home/hadoop/flumeSpool-10 }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
- java.nio.charset.MalformedInputException: Input length = 1
- <span style="white-space:pre"> </span>at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
- <span style="white-space:pre"> </span>at org.apache.flume.serialization.ResettableFileInputStream.readChar(ResettableFileInputStream.java:195)
- <span style="white-space:pre"> </span>at org.apache.flume.serialization.LineDeserializer.readLine(LineDeserializer.java:133)
- <span style="white-space:pre"> </span>at org.apache.flume.serialization.LineDeserializer.readEvent(LineDeserializer.java:71)
- <span style="white-space:pre"> </span>at org.apache.flume.serialization.LineDeserializer.readEvents(LineDeserializer.java:90)
- <span style="white-space:pre"> </span>at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readEvents(ReliableSpoolingFileEventReader.java:252)
- <span style="white-space:pre"> </span>at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:228)
- <span style="white-space:pre"> </span>at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
- <span style="white-space:pre"> </span>at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
- <span style="white-space:pre"> </span>at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
成功的实验一
一排数字,什么符号都没有
成功的实验二
如上所示,不缺定是否使用了”回车符“。
把Flume的Source设置为 Spooling directory source的更多相关文章
- Spooling Directory Source使用技巧
1.使用文件原来的名字 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 a1.sources=r1 a1.sinks=k1 a1.sources.r1.ty ...
- Flume-Spooling Directory Source 监控目录下多个新文件
使用 Flume 监听整个目录的文件,并上传至 HDFS. 一.创建配置文件 flume-dir-hdfs.conf https://flume.apache.org/FlumeUserGuide.h ...
- gen already exists but is not a source folder. Convert to a source folder or rename it.
异常提示: gen already exists but is not a source folder. Convert to a source folder or rename it. 错误原因 ...
- 将Samba设置为Active Directory域控制器
一 简介 从版本4.0开始,samba可以作为Active Directory(AD)域控制器(DC)运行,如果在生产环境中安装samba,建议运行两个或者多个DC用于故障转移 本文介绍如何让将一个S ...
- Flume的Avro Sink和Avro Source研究之一: Avro Source
问题 : Avro Source提供了怎么样RPC服务,是怎么提供的? 问题 1.1 Flume Source是如何启动一个Netty Server来提供RPC服务. 由GitHub上avro-rpc ...
- flume 1.4 设置FLUME_CONF_DIR没用
今天安装Apache Flume 1.4的时候,发现设置了FLUME_CONF_DIR环境变量和flume-env.sh后,运行flume-ng时flume-env.sh中的JAVA_HOME没有生效 ...
- Configuration must specify a spooling directory
启动spooling源时报错: 原因:spooling配置文件有误 a1.sources.r1.type = spooldir a1.sources.r1.spooldir = /usr/local/ ...
- WPF Image Source 设置相对路径图片
BitmapImage bt = new BitmapImage(new Uri("Images\\3_u10484.png", UriKind.Relative));this.I ...
- eclipse调试(debug)的时候,出现Source not found,Edit Source Lookup Path,一闪而过
问题描述 使用Eclipse调试代码的时候,打了断点,经常出现Source not found,网上找了半天,大部分提示点击Edit Source Lookup Path,添加被调试的工程,然而往往没 ...
随机推荐
- (图解版)SQL Server数据库备份与还原
本文介绍了SQL Server数据库备份的两种方式.一种是直接拷贝数据库中的文件mdf 和日志文件ldf,另一种是生成脚本语言. 第一种方式: 选中需要备份的数据库,将数据库从运行的数 ...
- JS、jqueryie6浏览器下使用js无法提交表单的解决办法
-----------------------JS.jqueryie6浏览器下使用js无法提交表单的解决办法---------------------------------------------- ...
- UI:字典的两种取值的区别
字典的两种取值的区别 (objectForKey: 和 valueForKey )参考 一般来说 key 可以是任意字符串组合,如果 key 不是以 @ 符号开头,这时候 valueForKey: 等 ...
- 移动端轮播图插件(支持Zepto和jQuery)
一. 效果图 二. 功能介绍 1. 支持图片自动轮播和非自动轮播 2. 支持点击和滑动. 三. 简单介绍 代码都有注释,逻辑简单,不做更多赘述. 1. 在你的html中添加一行. <sectio ...
- 为什么要把js代码写到<!--//-->中
是为了兼容,不支持js的浏览器会把其中的内容当做html注释.
- Slony-I的 RemoteWorker重试调查
客户的问题是: 向Slony-I运行环境中,增加新的slaveDB节点的时候发生错误. log中反复出现错误,然后再重新开始(重新开始部分的log省略): CONFIG remoteWorkerThr ...
- jQuery hover事件鼠标滑过图片半透明标题文字滑动显示隐藏
1.效果及功能说明 hover事件制作产品图片鼠标滑过图片半透明,标题文字从左到右滑动动画移动显示隐藏 2.实现原理 首先把效果都隐藏,然后定义一个伪类来触发所有的效果,接下来当触发伪类后会有一个遍历 ...
- [原创]jQuery的this和$(this)
网上有很多关于jQuery的this和$(this)的介绍,大多数只是理清了this和$(this)的指向,其实它是有应用场所的,不能一概而论在jQuery调用成员函数时,this就是指向dom对象. ...
- Effective C++笔记04:设计与声明
条款18:让接口easy被正确使用,不易被误用 1,好的接口非常easy被正确使用,不easy被误用.你应该在你的全部接口中努力达成这些性质. 2,"促进正使用"的办法包含接口的一 ...
- sublime添加ctags实现代码跳转
本次操作是在sublime text 2下进行. 1.先到http://sublime.wbond.net/Package%20Control.sublime-package下载Package Con ...