【问题标题】:Unable to connect flume with mongodb无法将水槽与 mongodb 连接
【发布时间】:2016-05-13 13:22:23
【问题描述】:

我是 Hadoop 新手,我正在使用 Cloudera Quickstart,我想将 flume 与我的 mongodb 连接。我不知道如何将水槽连接到设置了用户名和密码的 mongoDB。我使用源类型为netcat,通道类型为memory,接收器类型为hdfs

我的flume.conf 文件

# Please paste flume.conf here. Example:
# Sources, channels, and sinks are defined per
# agent name, in this case 'tier1'.
tier1.sources  = source1
tier1.channels = channel1
tier1.sinks    = sink1
# For each source, channel, and sink, set
# standard properties.
tier1.sources.source1.type     = netcat
tier1.sources.source1.bind     = 192.168.x.xxx
tier1.sources.source1.port     = 27017
tier1.sources.source1.channels = channel1
tier1.channels.channel1.type   = memory
tier1.sinks.sink1.type         = hdfs
tier1.sinks.sink1.hdfs.path    = /user/cloudera/flume
tier1.sinks.sink1.hdfs.fileType = DataStream
tier1.sinks.sink1.channel      = channel1

# Other properties are specific to each type of
# source, channel, or sink. In this case, we
# specify the capacity of the memory channel.
tier1.channels.channel1.capac

【问题讨论】:

    标签: hadoop hdfs cloudera flume


    【解决方案1】:

    我无法理解您是否真的想写入 MongoDB 或从 MongoDB 读取。

    如果你想到 MongoDB,你已经有一个 good starting point 来扩展或开发你自己的 custom sink

    如果您想从 MongoDB 读取,则需要按照Flume Developer Guide 中提到的示例从头开始实施解决方案(您可以重复使用来自上面提供的 GitHub 链接的代码)。

    【讨论】:

    • 我点击了这个链接,但我的 mongodb 受到用户名和密码的保护。那么我如何读取受用户名和密码保护的 mongodb,如果您提供一些示例 conf 文件会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 2020-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-06
    • 2022-01-14
    相关资源
    最近更新 更多