Exercise 2. Managing Hadoop Clusters With Apache Ambari: Estimated Time

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

V11.

2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty

Exercise 2. Managing Hadoop clusters


with Apache Ambari
Estimated time
00:45

Overview
This exercise introduces you to the Apache Ambari Web UI. You perform basic tasks, which provide
you a first-hand experience with Apache Ambari to manage your Hadoop cluster.

Objectives
After completing this exercise, you will be able to:
• Manage Hadoop clusters with Apache Ambari.
• Explore services, hosts, and alerts with the Ambari Web UI.
• Use Ambari Rest APIs.

Introduction
The Apache Ambari project is aimed at making Hadoop management simpler by developing
software that enables system administrators to perform the following tasks on a Hadoop cluster:
• Provision: provides a wizard for installing Hadoop services across any number of hosts and
handling configuration of Hadoop services for the cluster.
• Manage: provides central management for starting, stopping, and reconfiguring Hadoop
services across the entire cluster.
• Monitor: provides a dashboard for monitoring health and status of the Hadoop cluster. Also,
Ambari uses Ambari Metrics System ("AMS") for metrics collection and Ambari Alert
Framework for system alerting. These functions notify you when your attention is needed.
Ambari enables application developers and system integrators to easily integrate Hadoop
provisioning, management, and monitoring capabilities to their own applications with the Ambari
REST APIs.
In this exercise, you start the Ambari Web UI. You explore services, hosts, and alerts by using the
Ambari Web UI. Finally, you explore some of the Ambari REST APIs

Requirements
• Complete “Exercise 1. Exploring the lab environment”.

© Copyright IBM Corp. 2016, 2021 2-1


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty
Exercise instructions
In this exercise, you complete the following tasks:
__ 1. Start the Apache Ambari Web UI.
__ 2. Explore Services, Hosts, and Alerts with the Ambari Web UI.
__ 3. Explore the Apache Ambari REST APIs.

Part 1: Starting the Apache Ambari Web UI


In this part, you start the Apache Ambari Web UI, which you use to manage your Apache Hadoop
cluster.
Complete the following steps:
__ 1. Enter the Ambari URL <hostname:8080> that you recorded in Exercise 1 in your browser
address bar.
__ 2. Sign in to the Ambari Web UI with your Username <ambari username> and Password
<ambari password> from the table in Exercise 1.

The Dashboard page is displayed.

© Copyright IBM Corp. 2016, 2021 2-2


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty

Ambari Web UI displays the Dashboard page as the home page. You can use the Dashboard
to view the operating status of your cluster.
The left pane of the Ambari Web UI displays the list of Hadoop services currently running in
your cluster. The dashboard includes Metrics, Heatmaps, and Config History tabs; by default,
the Metrics tab is displayed. On the Metrics page, multiple widgets, represent operating status
information of services in your HDP cluster.

Part 2: Explore Services, Hosts, and Alerts with the Ambari Web UI
In this part, you explore the Services, Hosts, and Alerts options in the left pane or the Ambari Web
UI.
Complete the following steps:
__ 1. Click the Hive service that is listed under Services on the left pane. You see the SUMMARY
and CONFIGS tabs.
__ 2. Select the SUMMARY tab to review overview information about the Hive service.

© Copyright IBM Corp. 2016, 2021 2-3


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty

Summary displays basic information about the operational status of the selected service.
__ 3. Select the CONFIGS tab.

Performance of Hadoop components in a cluster can be optimized by adjusting configuration


settings and property values. Changing settings and configuration values requires to log in with
an Ambari admin account.
You can use the following tabs:
• SETTINGS: Manage Smart Configs to configure settings by adjusting the slider buttons.
• DATABASE: Manage database configurations
• ADVANCED: Edit advanced configuration properties and values.

© Copyright IBM Corp. 2016, 2021 2-4


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty
__ 4. Click HOSTS on the left pane.

The Hosts page is displayed

If you have an Ambari administrator account, you can use the Ambari Web UI Hosts page to
manage various Hortonworks Data Platform (HDP) components, for example, DataNodes.
DataNodes store data in a Hadoop cluster and it is the name of the daemon that manages the
data. DataNodes run on hosts throughout your cluster. For example, you can restart all
DataNode components, and optionally control this task with rolling restarts. From the Ambari
Hosts page, you filter your selection of host components to manage, based on operating status,
host health, and defined host groupings.
On the Hosts page, you can perform the following actions:
• Work with hosts
• Determine host status
• Filter the hosts list
• Perform host-level actions
• View components on a host
• Decommission Primary and Subordinates.
__ 5. Navigate to Alerts on the left pane. From the Alerts page, you can browse the list of alerts
that are defined for your cluster

© Copyright IBM Corp. 2016, 2021 2-5


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty

As you can see, each alert reports an alert status that indicates the alert severity. The most
common severity levels are OK, WARNING, and CRIT, but there are also other severities such
as UNKNOWN and NONE.
The alert statuses on your screen might be different than the ones shown in the figure.

Part 3: Exploring the Apache Ambari Rest APIs


In this part, you monitor and manage the resources in your cluster by using the Ambari REST API.
Complete the following steps:
__ 1. Open a Terminal on your local workstation.
__ 2. Run the following command in one line to view the hosts available on your cluster.
curl -i -u <ambari username>:<ambari password> <Ambari URL>/api/v1/hosts
Where <ambari username>, <ambari password>, and Ambari URL <hostname:8080> are
the ones that you recorded in Exercise 1.
For example:
curl -i -u myambari_user:my_ambari_password http://dataengineer.ibm.com:8080/api/v1/hosts

© Copyright IBM Corp. 2016, 2021 2-6


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty
The results are similar to the following output:
HTTP/1.1 200 OK
Date: Tue, 15 Sep 2020 02:08:59 GMT
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
Set-Cookie:
AMBARISESSIONID=node01bp5o5ar92m111rfq6qq7ubych19.node0;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain;charset=utf-8
X-Content-Type-Options: nosniff
Vary: Accept-Encoding, User-Agent
Transfer-Encoding: chunked

{
"href" : "http://41.58.181.236:8080/api/v1/hosts",
"items" : [
{
"href" :
"http://41.58.181.236:8080/api/v1/hosts/dataengineer.ibm.com",
"Hosts" : {
"cluster_name" : "BDE_Cluster",
"host_name" : "dataengineer.ibm.com"
}
}
]
}
__ 3. Run the following command in one line to get details of the HDFS service in your cluster.
curl -i -u <ambari username>:<ambari password> <Ambari
URL>/api/v1/clusters/<cluster name>/services/HDFS
Where <ambari username>:<ambari password> <Ambari URL> are the ones that you
recorded in Exercise.
For example,
curl -i -u myambari_user:my_ambari_password
http://dataengineer.ibm.com:8080/api/v1/clusters/BDE_Cluster/services/HDFS
The results are similar to the following partial output.

© Copyright IBM Corp. 2016, 2021 2-7


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty

© Copyright IBM Corp. 2016, 2021 2-8


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty

Review the list of alerts, components, and artifacts.

End of exercise

© Copyright IBM Corp. 2016, 2021 2-9


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V11.2
Exercise 2. Managing Hadoop clusters with Apache Ambari

EXempty
Exercise review and wrap-up
In this exercise, you used the Ambari Web UI to perform basic tasks to gain a first-hand experience
in accessing Hadoop clusters. You reviewed the Ambari Dashboard to understand the metrics that
are reported on the Dashboard page. You reviewed general information about services status,
configuration, and alerts. Finally, you used Ambari REST API to monitor resources.

© Copyright IBM Corp. 2016, 2021 2-10


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

You might also like