Book Image

Apache Oozie Essentials

By : Jagat Singh
Book Image

Apache Oozie Essentials

By: Jagat Singh

Overview of this book

As more and more organizations are discovering the use of big data analytics, interest in platforms that provide storage, computation, and analytic capabilities is booming exponentially. This calls for data management. Hadoop caters to this need. Oozie fulfils this necessity for a scheduler for a Hadoop job by acting as a cron to better analyze data. Apache Oozie Essentials starts off with the basics right from installing and configuring Oozie from source code on your Hadoop cluster to managing your complex clusters. You will learn how to create data ingestion and machine learning workflows. This book is sprinkled with the examples and exercises to help you take your big data learning to the next level. You will discover how to write workflows to run your MapReduce, Pig ,Hive, and Sqoop scripts and schedule them to run at a specific time or for a specific business requirement using a coordinator. This book has engaging real-life exercises and examples to get you in the thick of things. Lastly, you’ll get a grip of how to embed Spark jobs, which can be used to run your machine learning models on Hadoop. By the end of the book, you will have a good knowledge of Apache Oozie. You will be capable of using Oozie to handle large Hadoop workflows and even improve the availability of your Hadoop environment.
Table of Contents (16 chapters)
Apache Oozie Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running Sqoop command line


The syntax for the Oozie Sqoop command-line execution is shown in the following screenshot:

Sqoop command line

Let's import all records for the table to HDFS.

Note

For sample MySQL database preparation, I have created one script in the folder <BOOK_CODE_HOME>/ch07/sqoop_commandline/loadToMySQL.sh, using which you can create one database to test the Sqoop import.

The database name is rainfall and table is rainfall_data. We can import all the records from this table using the Sqoop command-line import option. To create the test Dataset, execute the steps written in loadToMySQL.sh.

We are ready to run the job. I have saved the following command in the script <BOOK_CODE_HOME>/ch07/sqoop_commandline/import_all_records.sh:

oozie sqoop -oozie http://localhost:11000/oozie -command import --
connect jdbc:mysql://localhost:3306/rainfall --username root --
password "" --table rainfall_data --target-dir 
'/user/hue/learn_oozie/ch07/sqoop_commandline/rainfall/output' ...