Working with MongoDB using Spark to Read/Write the Data [Activity] | Big Data Hadoop Tutorial

Published: 23 June 2022
on channel: AmpCode
4,193
22

This lecture is all about integrating MongoDB with Spark to Read/Write the data where we have used Apache Spark with Python (PySpark) to perform write and read operation on MongoDB on HDP Hadoop Sandbox. Below are the steps/commands to get the required files and execute the Spark job on the Hadoop Cluster.

--------------------------------------------------------------------------------------------------------------------
Required commands for this lecture:

wget https://raw.githubusercontent.com/ash...

hadoop fs -mkdir /user/maria_dev/mongodb

hadoop fs -copyFromLocal movies.user /user/maria_dev/mongodb/movies.user

wget https://raw.githubusercontent.com/ash...

export SPARK_MAJOR_VERSION=2

spark-submit --packages org.mongodb.spark:mongo-spark-connector_2.11:2.3.2 mongospark.py

mongo

----------------------------------------------------------------------------------------------------------------
In the previous lecture we have seen MongoDB Installation on HDP Sandbox where we have imported the MongoDB - Ambari connector and installed, deployed MongoDB on the Hadoop cluster. Below are the commands to help you install MongoDB step-by-step.

su root
cd /var/lib/ambari-server/resources/stacks/HDP/2.6.5/services
git clone https://github.com/nikunjness/mongo-a...
sudo service ambari restart
------------------------------------------------------------------------------------------------------------------
Got to Ambari and set up MongoDB:
If you face issues login as admin:
su root
ambari-admin-password-reset
------------------------------------------------------------------------------------------------------------------
pip install pymongo==3.4.0
mongo
if mongo gives any error (first give "export LC_ALL=C" first)
-----------------------------------------------------------------------------------------------------------------------

HDP Sandbox Installation links:

Oracle VM Virtualbox: https://download.virtualbox.org/virtu...

HDP Sandbox link: https://archive.cloudera.com/hwx-sand...

HDP Sandbox installation guide: https://hortonworks.com/tutorial/sand...

-------------------------------------------------------------------------------------------------------------

Also check out similar informative videos in the field of cloud computing:


What is Big Data:    • What is Big Data? | Big Data Use Case...  


How Cloud Computing changed the world:    • How Cloud Computing changed the world!  

What is Cloud?    • What is Cloud Computing?  

Top 10 facts about Cloud Computing that will blow your mind!    • Top 10 facts about Cloud Computing th...  

Audience

This tutorial is made for professionals who are willing to learn the basics of Big Data Analytics using Hadoop Ecosystem and become a Hadoop Developer. Software Professionals, Analytics Professionals, and ETL developers are the key beneficiaries of this course.

Prerequisites

Before you start proceeding with this course, I am assuming that you have some basic knowledge to Core Java, database concepts, and any of the Linux operating system flavors.

---------------------------------------------------------------------------------------------------------------------------

Check out our full course topic wise playlist on some of the most popular technologies:

SQL Full Course Playlist-
   • SQL Full Course  


PYTHON Full Course Playlist-
   • Python Full Course  

Data Warehouse Playlist-

   • Data Warehouse Full Course  


Unix Shell Scripting Full Course Playlist-
   • Unix Shell Scripting Full Course  

--------------------------------------------------------------------------------------------------------------------------
Don't forget to like and follow us on our social media accounts which are linked below.

Facebook-
  / ampcode  

Instagram-
  / ampcode_tutorials  

Twitter-
  / ampcodetutorial  

Tumblr-
ampcode.tumblr.com

-------------------------------------------------------------------------------------------------------------------------

Channel Description-

AmpCode provides you e-learning platform with a mission of making education accessible to every student. AmpCode will provide you tutorials, full courses of some of the best technologies in the world today.By subscribing to this channel, you will never miss out on high quality videos on trending topics in the areas of Big Data & Hadoop, DevOps, Machine Learning, Artificial Intelligence, Angular, Data Science, Apache Spark, Python, Selenium, Tableau, AWS , Digital Marketing and many more.

#bigdata #datascience #technology #dataanalytics #datascientist #hadoop #hdfs #hdp #mongodb #cassandra #hbase #nosqldatabase #nosql #pyspark #spark


Watch video Working with MongoDB using Spark to Read/Write the Data [Activity] | Big Data Hadoop Tutorial online without registration, duration hours minute second in high quality. This video was added by user AmpCode 23 June 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,193 once and liked it 22 people.