Then go to the Mongo-hadoop directory and find BUILD.SBT to modify hadoop920.html ">release in Thisbuild as follows:
Hadooprelease in Thisbuild: = "0.20"
Then run./SBT package (about SBT Https://github.com/harrah/xsbt/wiki)
It is necessary to turn the & wall when running.
At the end of the run, a jar file Mongo-hadoop-core_0.20.205.0-1.0.1.jar is core/target in the directory, then the MongoDB driver package is downloaded.
wget--no-check-certificate Https://github.com/downloads/mongodb/mongo-java-driver/mongo-2.7.3.jar After downloading, you can start to develop the Mongo-hadoop program.
Run the sample: first import the data into the MongoDB, and the commands are as follows.
./SBT Load-sample-data
Then create a new project in Eclipe, such as Treasury, to copy the source and resource files from Mongo-hadoop/example/treasury_field to the new project.
As shown in the figure:
Then modify the URL of the MongoDB in the Mongo-treasury_yield.xml file and store collection
Run Hadoop jar Treasury.jar Com.mongodb.hadoop.treasury.TreasuryXMLConfig to run the Hadoop program. The results of the operation are as follows: Data in MongoDB.
Copyright: Original works, allow reprint, reprint, please be sure to hyperlink form to indicate the original source of the article, author information and this statement. Otherwise, it will be held liable http://www.51ou.com/browse/MongoDB/51808.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.