2015-04-18 122 views
0

我遵循火花流+水槽整合的指导。但我最终无法得到任何事件。 (https://spark.apache.org/docs/latest/streaming-flume-integration.html) 任何人都可以帮我分析一下吗? 在烟气中,我创建“avro_flume.conf”的文件,如下所示:火花流整合水槽

描述/配置源

a1.sources = r1 
a1.channels = c1 
a1.sources.r1.type = avro 
a1.sources.r1.channels = c1 
a1.sources.r1.bind = 123.57.54.113 
a1.sources.r1.port = 4141 

描述水槽

a1.sinks = k1 
a1.sinks.k1.type = avro 

使用一个信道,它缓冲事件在内存中

a1.channels.c1.type = memory 
a1.channels.c1.capacity = 1000 
a1.channels.c1.transactionCapacity = 100 

将源和接收器绑定到通道

a1.sources.r1.channels = c1 
a1.sinks.k1.channel = c1 
a1.sinks.k1.hostname = 123.57.54.113 
a1.sinks.k1.port = 6666 
a1.sources = r1 
a1.sinks = spark 
a1.channels = c1 

在该文件中,123.57.54.113是localhost的ip。

我启动编程如下:

1.启动剂

flume-ng agent -c . -f conf/avro_spark.conf -n a1 Start Spark-streaming 

2.启动火花流例如

bin/run-example org.apache.spark.examples.streaming.FlumeEventCount 123.57.54.113 6666 

3.Then我启动阿夫罗-cilent

flume-ng avro-client -c . -H 123.57.54.113 -p 4141 -F test/log.01 

4.test/log.01“i是由echo创建的文件,其中包含一些字符串

最后,根本没有事件。

有什么问题? 谢谢!

回答

1

我在标题为“绑定源和接收器到通道”下看到“a1.sinks = spark”。但名称为“spark”的接收器未在您的配置中的其他位置定义。 你在尝试方法1还是方法2从“https://spark.apache.org/docs/latest/streaming-flume-integration.html”?

尝试删除行 “a1.sinks =火花”,如果你想办法1.

对于方法2使用下面的模板:

agent.sinks = spark 
agent.sinks.spark.type = org.apache.spark.streaming.flume.sink.SparkSink 
agent.sinks.spark.hostname = <hostname of the local machine> 
agent.sinks.spark.port = <port to listen on for connection from Spark> 
agent.sinks.spark.channel = memoryChannel