DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Offline Data Pipeline Best Practices Part 2:Optimizing Airflow Job Parameters for Apache Hive
  • Offline Data Pipeline Best Practices Part 1:Optimizing Airflow Job Parameters for Apache Hive
  • Step-By-Step Guide to Building a High-Performing Risk Data Mart
  • Apache Ranger and AWS EMR Automated Installation and Integration Series (5): Windows AD + Open-Source Ranger

Trending

  • Architecting Proactive IT: NinjaOne Remote Monitoring and Management
  • Engineering Closed-Loop Graph-RAG Systems, Part 3: Closing the Loop in Graph-RAG Systems
  • Is the Data Warehouse Dead? 3 Patterns From Enterprise Architecture That Answer This Question
  • How to Interpret the Number of Spring ApplicationContexts in Integration Tests

Apache Hive on YARN

Using Apache Hive on YARN enables Hadoop to support more varied processing approaches and a broader array of applications. Learn how to do it in this article!

By 
Anubhav Tarar user avatar
Anubhav Tarar
·
Jul. 02, 17 · Tutorial
Likes (6)
Comment
Save
Tweet
Share
16.7K Views

Join the DZone community and get the full member experience.

Join For Free

YARN is a software rewrite that decouples MapReduce’s resource management and scheduling capabilities from the data processing component, enabling Hadoop to support more varied processing approaches and a broader array of applications. For example, Hadoop clusters can now run interactive querying and streaming data applications simultaneously with MapReduce batch jobs. In this blog, we will use Apache YARN on Apache Hive. Let's get started!

Add the file yarn-site.xml inside your /usr/local/hadoop/etc/hadoop folder with the following content:

<configuration>
	<property>
		<name>yarn.app.mapreduce.am.resource.mb</name>
		<value>1024</value>
	</property>
	<property>
		<name>yarn.app.mapreduce.am.command-opts</name>
		<value>-Xmx768m</value>
	</property>
	<property>
		<name>mapreduce.framework.name</name>
		<value>yarn</value>
		<description>Execution framework.</description>
	</property>
	<property>
		<name>mapreduce.map.cpu.vcores</name>
		<value>1</value>
		<description>The number of virtual cores required for each map task.</description>
	</property>
	<property>
		<name>mapreduce.reduce.cpu.vcores</name>
		<value>1</value>
		<description>The number of virtual cores required for each map task.</description>
	</property>
	<property>
		<name>yarn.nodemanager.aux-services</name>
		<value>mapreduce_shuffle</value>
	</property>
	<property>
		<name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
		<value>org.apache.hadoop.mapred.ShuffleHandler</value>
	</property>
	<property>
		<name>mapreduce.map.memory.mb</name>
		<value>1024</value>
		<description>Larger resource limit for maps.</description>
	</property>
	<property>
		<name>mapreduce.map.java.opts</name>
		<value>-Xmx768m</value>
		<description>Heap-size for child jvms of maps.</description>
	</property>
	<property>
		<name>mapreduce.reduce.memory.mb</name>
		<value>1024</value>
		<description>Larger resource limit for reduces.</description>
	</property>
	<property>
		<name>mapreduce.reduce.java.opts</name>
		<value>-Xmx768m</value>
		<description>Heap-size for child jvms of reduces.</description>
	</property>
	<property>
		<name>mapreduce.jobtracker.address</name>
		<value>jobtracker.alexjf.net:8021</value>
	</property>
</configuration>

First, start the DFS with the following command:dfs.png

Next, start the YARN Resource Manager with the command yarn resourcemanager start: dfs1.png

Then, start the YARN Node Manager with the command yarn nodemanager start:dfs2.pngdf3

Start your Hive CLI and fire an insert into the query since it is a MapReduce query:dfs4.png

Now, why does this job fail? There are two ways to see the application logs. One is by typing command yarn logs -applicationId <applicationId>:df8.png

...and the other is through navigating to job rankings specified by the YARN UI job tracking URL.dfs5.png

From the error message, you can see that you’re using more virtual memory than your current limit of 1.0 gb. This can be resolved in two ways; one is by increasing the memory of yarn.app.mapreduce.am.resource.mb to a higher value such as 4096. The other is specifying this when starting Hive fires your query:

dfs6

Now, even if you navigate to the YARN UI, the query is successful.dfs7That's it! I hope that this blog is helpful for for those starting with Apache Hive and YARN.

Apache Hive

Published at DZone with permission of Anubhav Tarar. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Offline Data Pipeline Best Practices Part 2:Optimizing Airflow Job Parameters for Apache Hive
  • Offline Data Pipeline Best Practices Part 1:Optimizing Airflow Job Parameters for Apache Hive
  • Step-By-Step Guide to Building a High-Performing Risk Data Mart
  • Apache Ranger and AWS EMR Automated Installation and Integration Series (5): Windows AD + Open-Source Ranger

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook