无法将flume与mongodb连接

uwopmtnx  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(213)

我是hadoop新手,我正在使用cloudera quickstart,我想将flume与我的mongodb连接起来。我不知道如何连接flume到mongodb,mongodb设置了用户名和密码。我使用源类型作为 netcat ,通道类型为 memory Flume类型为 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
6mzjoqzu

6mzjoqzu1#

我无法理解你的问题,如果你真的想写信给mongodb或阅读mongodb。
如果你想写信给mongodb,你已经有了一个很好的起点来扩展或开发你自己的定制接收器。
如果您想从mongodb阅读,您需要按照flume开发人员指南中提到的示例从头开始实现一个解决方案(您可以重用上面提供的github链接中的部分代码)。

相关问题