我是Hadoop的新用户,我正在使用Cloudera Quickstart,我希望将flume与我的mongodb连接起来。我不知道如何将flume连接到已设置用户名和密码的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
答案 0 :(得分:1)
如果你真的想写信给MongoDB或者从MongoDB读取,我无法理解你的问题。
如果您希望编写到MongoDB,您已经有good starting point来扩展或开发自己的custom sink。
如果您希望从MongoDB 读取,则需要按照Flume Developer Guide中提到的示例从头开始实施解决方案(您可以重复使用某些部分)上面提供的GitHub链接的代码。)