把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,添加被调试的工程,然而往往没 ...
随机推荐
- C#用串口接收事件接不全数据的处理
问题描述:都知道用事件dataReceive来处理串口非常的方便,但当一次的数据过长时,就会出现截断数据的情况.比如说发一个指 令,返回一个30个字节的数据,但上位机则分两次来接收者30个数据. 解决 ...
- websocket的php测试demo
<?php class WS { var $master; var $sockets = array(); var $debug = false; var $handshake = false; ...
- mongodb的查询方式与sql语句对比
下面是sql和Mongodb对应的一些语法: SQL Statement Mongo Query Language Statement CREATE TABLE USERS (a Number, b ...
- iOS开发-HTTP请求
什么是URL?URL就是资源的地址.位置,互联网上的每个资源都有一个唯一的URLURL的基本格式: URL中常见的协议 (1)HTTP 超文本传输协议,访问的是远程的网络资源,格式是http:// h ...
- OpenCV 图像处理学习笔记(一)
解读IplImage结构 typedef struct _IplImage { int nSize; /* IplImage大小 */ int ID; ...
- Object Pascal对象模型中构造函数之研究
http://www.delphi2007.net/delphiblog/html/delphi_2004511950333715.html 前言 近期,一直在使用 C++ 与 Object Pasc ...
- CMSIS Example - Signal and Yield
/*---------------------------------------------------------------------------- * RL-ARM - RTX *----- ...
- How do I place a group of functions or variables in a specific section?
http://supp.iar.com/Support/?Note=27498 EWARM v5.xx (and newer) The placement of a few functions in ...
- Uva10474 - Where is the Marble?
两种解法: 1.计数排序 //计数排序 #include<cstdio> #include<iostream> #include<vector> #includ ...
- [Angular2 Router] Build Angular 2 Navigation with routerLink
Angular 2 navigation is configured using the routerLink directive. The routerLink directive behaves ...