我有Log4j2配置:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p - %m%n"/>
</Console>
<Flume name="flume" >
<MarkerFilter marker="FLUME" onMatch="ACCEPT" onMismatch="DENY"/>
<Agent host="IP_HERE" port="6999"/>
</Flume>
<File name="file" fileName="flume.log">
<MarkerFilter marker="FLUME" onMatch="ACCEPT" onMismatch="DENY"/>
</File>
</appenders>
<loggers>
<root level="info">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
<appender-ref ref="flume"/>
</root>
</loggers>
</configuration>
和Flume代理:
agent1.channels = ch1
agent1.sources = avro-source1
agent1.sinks = hdfs-sink1
agent1.channels.ch1.type = memory
agent1.sources.avro-source1.type = avro
agent1.sources.avro-source1.bind = IP_HERE
agent1.sources.avro-source1.port = 6999
agent1.sinks.hdfs-sink1.type = hdfs
agent1.sinks.hdfs-sink1.hdfs.path = hdfs://hadoop/user/hduser/bond/flume
agent1.sinks.hdfs-sink1.hdfs.fileType = DataStream
agent1.sinks.hdfs-sink1.hdfs.writeFormat = Text
agent1.sinks.hdfs-sink1.channel = ch1
agent1.sources.avro-source1.channels = ch1
当我发送日志时,第一次进入Web服务器控制台时出现错误:“错误对附加器水槽的递归调用”,(水槽代理处于活动状态,并且它正确地进行了绑定过程)在下一个记录器事件中没有错误和一个文件是在hadoop上编写的,但是当我尝试使用HUE在“文本”模式下对其进行可视化时,我看不到已发送的文本,我只能看到二进制代码...有什么错误吗?还是我必须做些什么才能以文本模式写入文件?谢谢
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句