【问题标题】:spark streaming integration flume火花流集成水槽
【发布时间】:2015-04-23 14:50:11
【问题描述】:

我遵循 Spark Streaming + Flume 集成的指导。但我最终无法得到任何事件。 (https://spark.apache.org/docs/latest/streaming-flume-integration.html) 谁能帮我分析一下? 在fume中,我创建了“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

将source和sink绑定到channel

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.然后我启动avro-cilent

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

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

到最后,什么事件都没有发生。

有什么问题? 谢谢!

【问题讨论】:

    标签: flume spark-streaming


    【解决方案1】:

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

    如果您尝试方法 1,请尝试删除“a1.sinks = spark”行。

    对于方法 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-21
      • 2019-04-11
      • 2016-09-29
      • 2019-02-18
      • 1970-01-01
      • 1970-01-01
      • 2017-04-27
      相关资源
      最近更新 更多