(未解决)flume监控目录,抓取文件内容推送给kafka,报错
flume监控目录,抓取文件内容推送给kafka,报错:
/export/datas/destFile/220104_YT1013_8c5f13f33c299316c6720cc51f94f7a0_2016101912_318.txt
2019-08-06 23:04:31,434 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:280)] FATAL: Spool Directory source r1: { spoolDir: /export/datas/destFile }: 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:283)
	at org.apache.flume.serialization.LineDeserializer.readLine(LineDeserializer.java:132)
	at org.apache.flume.serialization.LineDeserializer.readEvent(LineDeserializer.java:70)
	at org.apache.flume.serialization.LineDeserializer.readEvents(LineDeserializer.java:89)
	at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readDeserializerEvents(ReliableSpoolingFileEventReader.java:343)
	at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readEvents(ReliableSpoolingFileEventReader.java:331)
	at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:250)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
正常处理完文件后,应该删除该文件,应该提示这个信息:2019-08-06 23:04:31,412 (pool-3-thread-1) [INFO - org.apache.flume.client.avro.ReliableSpoolingFileEventReader.deleteCurrentFile(ReliableSpoolingFileEventReader.java:492)] Preparing to delete file
问题原因:文件的字符集编码是UTF-8,要手动设置一下字符集编码。
解决方案:a1.sources.r1.inputCharset = UTF-8 //将server.properties配置文件中的 inputCharset 设置为 UTF-8
还是没用,未解决。
貌似修复了程序的bug,这个问题就没再发生了,不过又有新的问题出现了:
2019-08-07 01:41:45,377 (pool-3-thread-1) [ERROR - org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:280)] FATAL: Spool Directory source r1: { spoolDir: /export/datas/destFile }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
java.lang.IllegalStateException: File has been modified since being read: /export/datas/destFile/220605_YT1013_ba701bb6bf74afb2f14a92de320bc023_2016101808_113.txt
	at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.retireCurrentFile(ReliableSpoolingFileEventReader.java:406)
	at org.apache.flume.client.avro.ReliableSpoolingFileEventReader.readEvents(ReliableSpoolingFileEventReader.java:326)
	at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:250)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
^C2019-08-07 01:42:11,310 (agent-shutdown-hook) [INFO - org.apache.flume.lifecycle.LifecycleSupervisor.stop(LifecycleSupervisor.java:78)] Stopping lifecycle supervisor 10
2019-08-07 01:42:11,320 (agent-shutdown-hook) [INFO - org.apache.flume.instrumentation.MonitoredCounterGroup.stop(MonitoredCounterGroup.java:149)] Component type: CHANNEL, name: c1 stopped
(未解决)flume监控目录,抓取文件内容推送给kafka,报错的更多相关文章
- python抓取不得姐动图(报错 urllib.error.HTTPError: HTTP Error 403: Forbidden)
		
抓取不得姐动图(报错) # -*- coding:utf-8 -*- #__author__ :kusy #__content__:文件说明 #__date__:2018/7/23 17:01 imp ...
 - 正则表达式抓取文件内容中的http链接地址
		
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; ...
 - shell脚本,如何监控目录下的文件内容是否被修改。
		
第一种方法是通过cmp来进行比对[root@localhost bo]# ls .html .html .html .html .html .html .html .html .html cat.sh ...
 - 如何让搜索引擎抓取AJAX内容?  转
		
越来越多的网站,开始采用"单页面结构"(Single-page application). 整个网站只有一张网页,采用 Ajax 技术,根据用户的输入,加载不同的内容. 这种做法的 ...
 - 如何让搜索引擎抓取AJAX内容?
		
越来越多的网站,开始采用"单页面结构"(Single-page application). 整个网站只有一张网页,采用Ajax技术,根据用户的输入,加载不同的内容. 这种做法的好处 ...
 - Python抓取视频内容
		
Python抓取视频内容 Python 是一种面向对象.解释型计算机程序设计语言,由Guido van Rossum于1989年底发明,第一个公开发行版发行于1991年.Python语法简洁而清晰,具 ...
 - 【java】抓取页面内容,提取链接(此方法可以http get无需账号密码的请求)
		
package 网络编程; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileOutpu ...
 - Springboot解决资源文件404,503等特殊报错,无法访问
		
Springboot解决资源文件404,503等特殊报错 原文链接:https://www.cnblogs.com/blog5277/p/9324609.html 原文作者:博客园--曲高终和寡 ** ...
 - 如何使用angularjs实现抓取页面内容
		
<html ng-app="myApp"> <head> <title>angularjs-ajax</title> <scr ...
 
随机推荐
- Linux双网卡bond、起子接口
			
适用场景 服务器两张网卡需要做bond,并且bond后网卡需配置不同网段的地址,用于走不同流量,这个时候就可以采用起子接口的方式. 实验场景 设备 服务器:Server_A 核心交换机:Switch_ ...
 - matplotlib动态图subplots()和subplot()不同及参数
			
一.fig,ax = subplots(nrows,ncols,sharex,sharey,squeeze,subplot_kw,gridspec_kw,**fig_kw) 创建画布和子图 nrow ...
 - 猴博士4小时讲完C语言视频教程
			
猴博士4小时讲完C语言视频教程,一共有9节课. 目录结构如下: 目录:/2020030-猴博士4小时讲完C语言 [1G] ┣━━1.C语言基本语句(上)(更多资源访问:www.jimeng365.cn ...
 - [Jenkins] Jenkins的启动停止并修改默认端口
			
在Win系统下面,经常使用Jenkins今天自动化测试工作,但是在搭建的时候还是有些坑 1.选择性安装: 一般会选择windows,会下载一个压缩包,然后step by step就可以安装成功,这个方 ...
 - php相关问题学习(以备面试)
			
1.原味地址:[ http://www.yiichina.com/tutorial/57 ] 注:本文转自 http://www.icultivator.com/p/5535.html 整理了一份PH ...
 - Go 语言 fmt.Sprintf (格式化输出)
			
Printf().Sprintf().Fprintf() 函数的区别用法是什么? 都是输出格式化字符串,只是输出到的目标不一样: Printf() 是把格式化字符串输出到标准到标准输出(一般是屏幕,可 ...
 - MYSQL客户端管理工具
			
双击安装navicact客户端管理工具: 双击启动脚本,并指定管理工具的navicat.exe文件 最后打开
 - python  csv 读写操作
			
import csv def read_csvList(path="./datasets/test.csv")->list: """return ...
 - 什么是Maven? 使用Apache Maven构建和依赖项管理
			
通过优锐课java架构学习中,学到了不少干货,整理分享给大家学习. 开始使用最流行的Java构建和依赖管理工具Maven Apache Maven是Java开发的基石,也是Java使用最广泛的构建管理 ...
 - list的使用-Hdu 1276
			
士兵队列训练问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Su ...