简体   繁体   中英

hadoop mongodb connector - output data not as mongodb but hdfs

是否可以从hadoop mongodb插件连接器中读取mongodb数据,使用mapreduce hadoop处理数据,并且在输出结果中不使用hadoop mongodb插件连接器,而将mapreduce hadoop的结果照原样保留在hdfs中?

I think this previous answer on SO answers your question, with a minor change:

Is it possible to read MongoDB data, process it with Hadoop, and output it into a RDBS(MySQL)?

The main difference is that you would set the OutputFormatClass to something like:

job.setOutputFormatClass( SequenceFileOutputFormat.class );

You'll also need to set the output path on HDFS you want to save the data to. See their WordCount example for a full code example, but use the above as the output format instead of MongoOutputFormat.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM