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 Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • MLOps: Definition, Importance, and Implementation
  • Mastering Time Series Analysis: Techniques, Models, and Strategies
  • Playwright JavaScript Tutorial: A Complete Guide
  • SRE vs. DevOps

Trending

  • MLOps: Definition, Importance, and Implementation
  • Mastering Time Series Analysis: Techniques, Models, and Strategies
  • Playwright JavaScript Tutorial: A Complete Guide
  • SRE vs. DevOps

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!

Anubhav Tarar user avatar by
Anubhav Tarar
·
Jul. 02, 17 · Tutorial
Like (6)
Save
Tweet
Share
15.52K 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, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • MLOps: Definition, Importance, and Implementation
  • Mastering Time Series Analysis: Techniques, Models, and Strategies
  • Playwright JavaScript Tutorial: A Complete Guide
  • SRE vs. DevOps

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: