2016-05-13 6 views
0

私はHadoopを初めて使用しています。私はCloudera Quickstartを使用しています。flumeをmongodbに接続したいと思います。私はユーザー名とパスワードを設定したmongoDBにflumeを接続する方法を知らない。ソースタイプをnetcat、チャネルタイプをmemory、シンクタイプをhdfsとしています。flongとmongodbを接続できません

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 

答えて

1

あなたが実際にMongoDBへの書き込みやMongoDBのから読みたい場合は質問から、私は理解できませんでした。あなたはMongoDBのにを書きしたい

私の場合は、すでに拡張したり、custom sinkを所有して開発するgood starting point持っています。あなたはしたい場合には

は、あなたが(あなたが上記のGitHubのリンクからコードの部分の一部を再利用することができFlume Developer Guideに言及した例以下、ゼロからソリューションを実装する必要があります、MongoDBのからを読みます)。

+0

私はこのリンクに従いましたが、私のmongodbはユーザー名とパスワードで保護されています。どのように私はmongodbをユーザ名とパスワードで保護しているのですか? – Ironman

+0

あなたがそれを好きなら質問をアップしてください。 – Ironman

関連する問題