2015-04-18 120 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