flume报java.nio.charset.MalformedInputException: Input length = 1 解决方案


Flume读取文件的过程中,遇到了如下的错误:

flume报java.nio.charset.MalformedInputException: Input length = 1 解决方案


问题原因:source组件的属性 inputCharset 默认的是 UTF-8, 但实际读取的文件类型是 ANSI(GBK)。

解决方案:a1.sources.r2.inputCharset = GBK  //将 inputCharset 设置为 GBK 即可。