You are on page 1of 8

Enabling Metrics Logging - Cloudera Support

Page 1 of 8

Cloudera.com
Cloudera University
Documentation
Developer Community
My Account
Contact Us
Downloads

Cloudera
Why Cloudera

Hadoop & Big Data


Doug Cutting, Cloudera's Chief Architect, wrote Apache Hadoop in 2006. Learn about Hadoop and its impact on Big Data.

Our Customers
See a selection of Cloudera customers and how they use Cloudera to ask bigger questions of all their data.

FAQs
We answer some of your most popular questions about Cloudera and our technology.

Blog
Explore thought, technical, and community leadership from Cloudera.

Products

Cloudera Enterprise Core


Discover our single Hadoop storage and management platform that natively combines storage, processing and exploration and offers real-time query
with Cloudera Enterprise RTQ powered by Cloudera Impala.

Cloudera Enterprise Free


Read how Cloudera Enterprise Free offers you all the essentials to evaluate Apache Hadoop.

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

Enabling Metrics Logging - Cloudera Support

Page 2 of 8

Cloudera Support
The industrys highest quality technical support for Hadoop.

Cloudera Manager
Explore the leading end-to-end management application for Hadoop.

CDH
Get details about our 100% open source distribution of Hadoop and other projects, designed for enterprise demands.

Latest Releases
Downloads & Installation
Professional Services
Training

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

Enabling Metrics Logging - Cloudera Support

Page 3 of 8

Work at the speed of thought with Cloudera Enterprise RTQ powered by Cloudera Impala.
Learn More

Solutions

Industries
Learn about Cloudera use cases across several major industries.

Applications
Explore the leading end-to-end management application for Hadoop.

Partner Solutions
See our list of the best complementary solutions for Cloudera Enterprise available.

Search

Partners

Partner Listing
Explore the largest partner ecosystem developing, integrating and deploying technology on Hadoop.

Cloudera Certified Technology


Let this program, unique in the Big Data industry, help guide you toward the right technology choices for your business.

Partner Program
Please login to access your Cloudera Connect Partner benefits, exclusive content, tools, training and more

Resources
Support
About
Management Team
Board
Investors
Events
Awards
Press Center

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

Enabling Metrics Logging - Cloudera Support

Page 4 of 8

Careers
Contact Us
Overview
Cloudera Partner Portal
Getting Started Guide
Developer Portal
Cloudera Certified
Technology
Software Certification
Guide
Hardware Certification
Guide
Get Certified on CDH4
Enabling Metrics
Logging
Partner Events Calendar
Sales and Marketing
Resources
Last-Minute Cloudera
University Training Seats
and Discounts
Get Smart on CDH4 and
CM4

Shankar Radhakrishnan | Log Out

Toggle Fullscreen
Cloudera Partner Portal

Cloudera Certified Technology

Enabling Metrics Logging

Enabling Metrics Logging

What is Metrics Logging


Many projects in the Apache Hadoop family offer two types of logging. The standard logging records messages from the
daemons about their status and any issues they encounter. Depending on the granularity of the messages that the
logging is set to record (known as the log level), the log messages can be anything from serious system failures to
detailed debugging information. Messages are written to the logs as the events they describe occur. The logs are
typically written to the logs folder in the root directory of the Hadoop installation.
In addition to standard logging, many components also offer metrics logging. As opposed to standard logging that writes
a message per event, metrics logging generates summary messages at regular intervals. Each line in a metrics log file
includes a high level summary of the state of the system at that moment. For example, a line in the metrics logs for
MapReduce might list the total number of jobs that have completed, the number of jobs that are currently running, the
total number of errors encountered so far, etc. The typical logging interval is every 10 seconds.

Latest Release
Downloads
Learn Hadoop
Documentation
Get Support

Customer Portal Feedback


Have comments about this
page?

Let us know!

Why Use Metrics Logs For Certification?


It would technically be possible to do the review required for certification with complete logs of either type. The
advantage of using metrics logs for the certification is that it's easy to see quickly what the performance of the cluster
was over the time period of the testing. The metrics logs are also very amenable to being processed by scripts. Teasing
that information out of the standard logs is possible but requires quite a bit more work.
One down side of using metrics logs for the certification testing is that they only serve to summarize the cluster state. If
there was an error, the metrics logs will show that there was an error, but they won't say what the error was. For that
information, the standard logs are required. When submitting testing logs for certification, it's always a good idea to
keep a copy of the standard logs on hand, so that if the metrics logs do turn up an issue, the standard logs can be used
to determine the severity and significance of the issue.

How to Enable Metrics Logging


Metrics logging is disabled by default. It is recommended for clusters that will be used to do integration testing with CDH
that metrics logging always be enabled. Doing so will make certification easier, since the metrics logs from the last
successful integration testing run can be submitted, rather than requiring a test run just to generate metrics logs.

Enabling Metrics Logging on CDH3

With Cloudera Manager


If you deployed your cluster using Cloudera Manager, the Cloudera Manager daemons will consume the metrics files,
making it effectively impossible to gather metrics files. It is recommended that if you are certifying against CDH3 that
you do not use Cloudera Manager to deploy the cluster.

Without Cloudera Manager


The process for enabling metrics logging on CDH3 is outlined in this blog post. Be sure that the hadoopmetrics.properties file is located in the conf directory that is active for the system. You can find additional information in
the JavaDocs. Certification testing requires the mrmetrics.log, dfsmetrics.log, and jvmmetrics.log for all nodes in the
test cluster.
Your resulting hadoop-metrics.properties files should contain the following lines:

dfs.class=org.apache.hadoop.metrics.file.FileContext
dfs.period=10

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

Enabling Metrics Logging - Cloudera Support

Page 5 of 8

dfs.fileName=/tmp/dfsmetrics.log
mapred.class=org.apache.hadoop.metrics.file.FileContext
mapred.period=10
mapred.fileName=/tmp/mrmetrics.log
jvm.class=org.apache.hadoop.metrics.file.FileContext
jvm.period=10
jvm.fileName=/tmp/jvmmetrics.log

Enabling Metrics Logging on CDH4 With YARN/MR2

With Cloudera Manager


Cloudera Manager 4 does not have native support for configuring metrics logging, but it does allow users the option of
manually entering configuration settings. To enable metrics logging for a CDH4 cluster via Cloudera Manager 4, follow
these steps:

1.
2.
3.
4.

From the "All Services" management screen, click on the HDFS service, hdfs1 by default.
Click on the Configuration tab in the top navigation bar.
Click on the Advanced tab under the DataNode heading in the tree in the left panel.
Locate the Hadoop Metrics2 Safety Valve field and enter the following into that field:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink

datanode.sink.file.filename=/tmp/datanode-metrics.out

5. Click on the Advanced tab under the NameNode heading in the tree in the left panel.
6. Locate the Hadoop Metrics2 Safety Valve field and enter the following into that field:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink

namenode.sink.file.filename=/tmp/namenode-metrics.out

7.
8.
9.
10.
11.
12.
13.

From the Actions pulldown in the upper right, select Restart... and click the Restart button on the popup window.
Click the Close button. You don't need to wait for the operation to complete.
Click the Services link in the bread crumbs in the upper left.
Click on the MapReduce service, mapreduce1 by default.
Click on the Configuration tab in the top navigation bar.
Click on the Advanced tab under the JobTracker heading in the tree in the left panel.
Locate the Hadoop Metrics2 Safety Valve field and enter the following into that field:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink

resourcemanager.sink.file.filename=/tmp/resourcemanager-metrics.out

14. Click on the Advanced tab under the TaskTracker heading in the tree in the left panel.
15. Locate the Hadoop Metrics2 Safety Valve field and enter the following into that field:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink

nodemanager.sink.file.filename=/tmp/nodemanager-metrics.out
mrappmaster.sink.file.filename=/tmp/mrappmaster-metrics.out

16. From the Actions pulldown in the upper right, select Restart... and click the Restart button on the popup window.
17. After the operation completes, click the Close button.
18. Verify that the correct files are being written into the /tmp directory on the cluster nodes.
Certification testing requires the namenode-metrics.out, datanode-metrics.out, resourcemanager-metrics.out,
nodemanager-metrics.out, and mrappmaster-metrics.out for all nodes in the test cluster.

You must use at least Cloudera Manager 4.0.3. Prior to that update, these was a bug that prevented the
hadoop-metrics2.properties from being written properly.

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

Enabling Metrics Logging - Cloudera Support

Page 6 of 8

Without Cloudera Manager


With MR2, metrics logging is governed by the hadoop-metrics2.properties file. Locate that file in the active conf directory
and uncomment the lines (by deleting the leading #) for datanode.sink.file.filename and namenode.sink.file.filename.
Using the datanode or namenode lines as a template, also add lines for resourcemanager.sink.file.filename,
nodemanager.sink.file.filename, and mrappmaster.sink.file.filename. Also make sure that the filenames pointed to by
those fields include a path to a location where the log files can be easily accessed, e.g. /tmp/namenode-metrics.out.
Certification testing requires the namenode-metrics.out, datanode-metrics.out, resourcemanager-metrics.out,
nodemanager-metrics.out, and mrappmaster-metrics.out for all nodes in the test cluster.
Your resulting hadoop-metrics2.properties files should contain the following lines:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink
*.period=10
namenode.sink.file.filename=/tmp/namenode-metrics.out
datanode.sink.file.filename=/tmp/datanode-metrics.out
resourcemanager.sink.file.filename=/tmp/resourcemanager-metrics.out
nodemanager.sink.file.filename=/tmp/nodemanager-metrics.out
mrappmaster.sink.file.filename=/tmp/mrappmaster-metrics.out

Enabling Metrics Logging on CDH4 With MR1

With Cloudera Manager


Cloudera Manager 4 does not have native support for configuring metrics logging, but it does allow users the option of
manually entering configuration settings. To enable metrics logging for a CDH4 cluster via Cloudera Manager 4, follow
these steps:

1.
2.
3.
4.

From the "All Services" management screen, click on the HDFS service, hdfs1 by default.
Click on the Configuration tab in the top navigation bar.
Click on the Advanced tab under the DataNode heading in the tree in the left panel.
Locate the Hadoop Metrics2 Safety Valve field and enter the following into that field:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink

datanode.sink.file.filename=/tmp/datanode-metrics.out

5. Click on the Advanced tab under the NameNode heading in the tree in the left panel.
6. Locate the Hadoop Metrics2 Safety Valve field and enter the following into that field:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink

namenode.sink.file.filename=/tmp/namenode-metrics.out

7.
8.
9.
10.
11.
12.
13.

From the Actions pulldown in the upper right, select Restart... and click the Restart button on the popup window.
Click the Close button. You don't need to wait for the operation to complete.
Click the Services link in the bread crumbs in the upper left.
Click on the MapReduce service, mapreduce1 by default.
Click on the Configuration tab in the top navigation bar.
Click on the Advanced tab under the JobTracker heading in the tree in the left panel.
Locate the Hadoop Metrics Safety Valve field and enter the following into that field:

mapred.class=org.apache.hadoop.metrics.file.FileContext
mapred.period=10
mapred.fileName=/tmp/mrmetrics.log
jvm.class=org.apache.hadoop.metrics.file.FileContext
jvm.period=10
jvm.fileName=/tmp/jvmmetrics.log

14. Click on the Advanced tab under the TaskTracker heading in the tree in the left panel.
15. Locate the Hadoop Metrics Safety Valve field and enter the following into that field:

mapred.class=org.apache.hadoop.metrics.file.FileContext
mapred.period=10
mapred.fileName=/tmp/mrmetrics.log
jvm.class=org.apache.hadoop.metrics.file.FileContext
jvm.period=10

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

Enabling Metrics Logging - Cloudera Support

Page 7 of 8

jvm.fileName=/tmp/jvmmetrics.log

16. From the Actions pulldown in the upper right, select Restart... and click the Restart button on the popup window.
17. After the operation completes, click the Close button.
18. Verify that the correct files are being written into the /tmp directory on the cluster nodes.
Certification requires the mrmetrics.log, jvmmetrics.log, namenode-metrics.out, and datanode-metrics.out for all nodes
in the test cluster.

You must use at least Cloudera Manager 4.0.3. Prior to that update, these was a bug that prevented the
hadoop-metrics2.properties from being written properly. Note that the hadoop-metrics.properties file is
handled correctly by earlier versions, so you may discover that the MapReduce metrics logs are being
written, but the HDFS metrics logs are not.

Without Cloudera Manager


When deploying a cluster with CDH4 using MR1, there are, in effect, two separate cluster installations. The datanode
and namenode are run from the CDH4 cluster, and the the jobtracker and tasktracker are run from the MR1 add-on.
Both clusters have their own independent cluster configurations.
To enable metrics logging for CDH4 with MR1, follow the instructions for both of the sections above. Follow the
instructions above for CDH4 with YARN/MR2 to configure the namenode and datanodes. Follow the instructions above
for CDH3 to configure the MR1 add-on for the jobtracker and tasktracker. Certification requires the mrmetrics.log,
jvmmetrics.log, namenode-metrics.out, and datanode-metrics.out for all nodes in the test cluster.
Your resulting hadoop-metrics2.properties files should contain the following lines:

*.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink
*.period=10
namenode.sink.file.filename=/tmp/namenode-metrics.out
datanode.sink.file.filename=/tmp/datanode-metrics.out

Your resulting hadoop-metrics.properties files should contain the following lines:

mapred.class=org.apache.hadoop.metrics.file.FileContext
mapred.period=10
mapred.fileName=/tmp/mrmetrics.log
jvm.class=org.apache.hadoop.metrics.file.FileContext
jvm.period=10
jvm.fileName=/tmp/jvmmetrics.log

Why Cloudera?
Hadoop & Big Data
Cloudera & Hadoop
Our Customers
FAQs
Blog
Products
Cloudera Enterprise Core
Cloudera Enterprise Free
Cloudera Manager
CDH
Latest Releases
All Downloads
Professional Services
Training

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

Enabling Metrics Logging - Cloudera Support

Page 8 of 8

Solutions
For Your Industry
For Your Use Case
Partner Solutions
Partners
Resource Library
Support
About
Team
Events
Awards
Press Center
Careers
Contact Us
Follow us:Share:
LinkedIn

Twitter
Facebook
YouTube
Cloudera
Cloudera, Inc. 220 Portage Avenue Palo Alto, CA 94306
www.cloudera.com US: 1-888-789-1488 Intl: 1-650-362-0488
2012 Cloudera, Inc. All rights reservedTerms & ConditionsSite Map Hadoop and the Hadoop elephant logo are trademarks of the Apache Software Foundation.

https://ccp.cloudera.com/display/PARTNERS/Enabling+Metrics+Logging

4/10/2013

You might also like