我正在使用flume将日志文件数据插入hbase表中,但没有向表中插入任何内容。Flume药剂如下:
agent1.sources = tail
agent1.channels = memoryChannel
agent1.sinks = loggerSink sink1
agent1.sources.tail.type = exec
agent1.sources.tail.command = tail -f /usr/local/jarsfortest/LogsForTest/generatingLogs-app.logs
agent1.sources.tail.channels = memoryChannel
agent1.sinks.loggerSink.channel = memoryChannel
agent1.sinks.loggerSink.type = logger
agent1.sinks.sink1.type = org.apache.flume.sink.hbase.HBaseSink
agent1.sinks.sink1.channel = memoryChannel
agent1.sinks.sink1.table = testFlume
agent1.sinks.sink1.columnFamily = log
agent1.sinks.sink1.serializer = org.apache.flume.sink.hbase.RegexHbaseEventSerializer
# agent1.sinks.sink1.serializer.regex = [a-zA-Z0-9]*[^C][a-zA-Z0-9]*[^C][a-zA-Z0-9]*
agent1.sinks.sink1.serializer.regex =[a-zA-Z0-9]*^C[a-zA-Z0-9]*^C[a-zA-Z0-9]*
agent1.sinks.sink1.serializer.colNames = id, no_fill_reason, bid
agent1.channels.memoryChannel.type = memory
agent1.channels.memoryChannel.capacity = 1000
以上代理已成功启动..但日志文件数据未插入到hbase中。日志文件数据如下:id0^cok^c10,即数据以控制字符分隔。请帮帮我。提前谢谢。
2条答案
按热度按时间ioekq8ef1#
我可以帮助分析根本原因。
使用ctrl+c终止
this flume-ng process
.仔细观察输出。将有三种类型的指标:
类型的关闭度量:源
类型:通道的关闭度量
类型的关闭度量:sink
例如:
在上面的例子中,问题是在下沉阶段,因为
drain.success
等于0。scyqe7ek2#
原因可能是regexpression不匹配,请按照以下步骤进行调试
1) 使用此选项仅启动一个代理
一旦你开始写剧本
听1044。。。
消息会来的。
2) 创建eclipse远程应用程序以连接到您的服务器名称和端口(如1044)
3)
getActions
方法负责将行放入hbase。。把一个断点放进去
getActions
方法EventSerializer
```public List getActions() throws FlumeException {
List actions = Lists.newArrayList();