SlideShare a Scribd company logo
Apache Ambari Workshop
Stacks, Blueprints, Views
We Do Hadoop
Ajay Singh, Ali Bajwa, Sean Roberts
Partner Solution Engineering
March-2015
Who
Ajay Singh
- Director
- ajaysingh@hortonworks.com
Ali Bajwa
- Engineer
- abajwa@hortonworks.com
Sean Roberts
- Engineer, London & EMEA
- @seano
Schedule
● Ambari Overview
● Stacks
● Blueprints
● Stack Services
● Views
Page 4 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
How do you Operate a Hadoop Cluster?
Apache Ambari is a
platform to provision,
manage and monitor
Hadoop clusters
Page 5 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Apache Ambari Themes
Operate Hadoop at
Scale
Deliver the core operational capabilities to provision,
manage and monitor Hadoop clusters at scale.
Integrate with the
Enterprise
Robust API for integration with existing enterprise systems,
such as Teradata Viewpoint and Microsoft SCOM.
Extend for the
Ecosystem
Provide extensible platform for Customers, Partners and
the Community to, such as Stacks and Views.
Page 6 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Hadoop Operations Platform
Apache Ambari is a 100% open source platform for
provisioning, managing and monitoring Apache Hadoop
clusters
AMBARI WEB
Others
compute
&
storage
. . .
. . .
. .
compute
&
storage
.
.EXTEND
AMBARI REST API
AMBARI SERVER
PROVISION | MANAGE | MONITOR
Integration with Existing Tools
OPERATE
AMBARI STACKS
Page 7 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Innovation at the Speed of Community
An active 100% open source Community:
• 90+ Contributors / 45+ Committers
• 270+ Ambari User Group Members
2014
Dec
Graduates to Apache Top Level Project
2013
Dec
Apache Ambari 1.7 Released
Adds support for Hortonworks Data Platform 2.2
Adds new operational and extensibility capabilities
Page 8 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Recent Ambari Releases
Ambari 1.6.0
May 2014
Ambari 1.5.1
Apr 2014
Ambari 1.5.0
Apr 2014
Ambari 1.6.1
Jul 2014
Introduced
Ambari Stacks
Introduced
Ambari Blueprints
HDP
2.1 GA
Ambari 1.7.0
Dec 2014
HDP
2.2 GA
Introduced
Ambari Views
Page 9 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Extensibility Features
• To add new Services (ISV or otherwise) beyond HDP Stack
• To customize a Stack for customer specific environments
• To use Ambari for automating cluster installations
• To share best practices on layout and cluster configuration
• To extend and customize the Ambari Web UI
• Add new capabilities, customize existing capabilities
Stacks
Blueprints
Views
Goal: Extend Ambari without hard-coding in Ambari
1.5.0
1.7.0
1.6.0
Page 10 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Anatomy of Ambari Extension Points
Ambari
Server
Ambari
AgentAmbari
AgentAmbari
Agent
Ambari
Web
Stacks
Stacks
Stacks
javajs python
Ambari
Views
Ambari
Stacks
Ambari
Blueprints
Ambari API
Page 11 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Partners Integrating With Ambari
Ambari Community
Apache Ambari: http://ambari.apache.org
● wiki: https://cwiki.apache.org/confluence/display/AMBARI/Ambari
● mail lists: https://ambari.apache.org/mail-lists.html
● issues: https://issues.apache.org/jira/browse/AMBARI
Hortonworks:
● forum: http://hortonworks.com/community/forums/forum/ambari/
● social media: twitter, facebook, slideshare, linkedin, ...
Partner Resources
This Workshop:
● github: http://git.io/jmz4 (https://github.com/abajwa-hw/ambari-workshops)
● blog: http://hortonworks.com/blog/apache-ambari-technical-workshop/
Past & Future Workshops:
● http://hortonworks.com/partners/learn/
Upcoming meetups and events:
● http://hortonworks.com/events/
Ambari Stacks
Page 15 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Stack Terminology
Term Definition Examples
STACK
Defines a set of Services, where to obtain the software
packages and how to manage the lifecycle.
HDP-2.0, HDP-1.3.3
SERVICE Defines the Components that make-up the Service. HDFS, NAGIOS, YARN
COMPONENT
The building-blocks of a Service, that adhere to a
certain lifecycle.
NAMENODE, DATANODE,
OOZIE_SERVER
CATEGORY The category of Component. MASTER, SLAVE, CLIENT
Page 16 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Stack Mechanics
Stacks define Services + Repos
What is in the Stack, and where to get the bits
Each Service has a definition
What Components are part of the Service
Each Service has defined lifecycle commands
start, stop, status, install, configure
Lifecycle is controlled via command scripts
Ability to define “custom” commands
AMBARI
SERVER
Stack
Command
Scripts
Service
Definitions
AMBARI
AGENT/S
AMBARI
AGENT/S
AMBARI
AGENT/S
pythonxml
Repos
Page 17 © Hortonworks Inc. 2011 – 2015. All Rights Reserved
Stacks Support Inheritance
HDP 2.0 Stack
HDP 2.1 Stack
• Defines a set of Service definitions
• Default service configurations and command scripts
• Overrides any Service definitions, commands and
configurations
• Adds new Services specific to this Stack
Deploying clusters of any scale with ease
Ambari Blueprints
Before Ambari
● Manual installation
● Manual configuration
● Manual distribution of configuration
● XML
● XML
● XML ...
Manual Install with Ambari Wizard
Automation with Ambari Blueprints
Stack Definition
Component
Layout
& Configuration
BLUEPRINT
BLUEPRINT INSTANTIATE CLUSTER
2 HTTP calls for a Deployed Cluster
{ "Blueprints": {
"stack_name": "HDP",
"stack_version": "2.2"
},
"host_groups": [
{ "name": "workers",
"components": [
{ "name": "DATANODE" },
{ "name": "JOURNALNODE" },
{ … … }
},
{ "name": "master-1",
"components": [
{ "name": "NAMENODE" },
{ … … }
}
]}
{ "Blueprints": {
"blueprint": "myblueprint",
"default_password": "awesome",
"configurations": [
{ "hive-site": { "properties": {
"hive.execution.engine": "tez" }}}],
"host_groups": [
{ "name": "master-1",
"hosts": [ { "fqdn": "hdp00" } ]},
{ "name": "workers"
"hosts": [ { "fqdn": "hdp01" },
{ "fqdn": "hdp01" },
{ "fqdn": "hdp.." },
{ "fqdn": "hdp99" }]}
]}
1) POST /api/v1/blueprints/myblueprint 2) POST /api/v1/clusters/mycluster
Export Cluster to Blueprint
GET /api/v1/clusters/my_cluster?format=blueprint
{ "configurations" : [
{ "cluster-env" : { "cluster_name" : "sandbox", ... }},
{ "hive-site" : { "hive.execution.engine" : "tez", ... }}
],
"host_groups" : [
{ "name" : "host_group_1",
"configurations" : [ ],
"components" : [
{ "name" : "NAMENODE" }, { "name" : "HIVE_SERVER"}, ...
],
"cardinality" : "1"
}],
"Blueprints" : { "stack_name" : "HDP", "stack_version" : "2.2" }
}
Live Demo
Command snippets: http://nbviewer.ipython.org/github/seanorama/ambari-
bootstrap/blob/master/api-examples/ambari-workshop-blueprints.ipynb
For API examples including Python versions in an ipython notebook:
https://github.com/seanorama/ambari-bootstrap/tree/master/api-examples
Ambari Stack Services
Page 26 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Files needed to create an Ambari service
• Service definition file (metainfo.xml)
• Service configuration file (myservice-config.xml)
• Service configuration parameters (params.py)
• Service master python script (master.py)
Not always needed:
• Service status configuration file (myservice-env.xml)
• Service status configuration parameters (status_params.py)
Page 27 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Service Definition (metainfo.xml)
● name – the internal name of the service (must be unique)
● displayName – the public display name of the service
● version – the version of the service
● component category – is the component a MASTER or CLIENT (one or more)
● script – the script that will be executed during service install, start, stop
● package – packages to be installed via yum during install
<service>
<name>MAVEN</name>
<displayName>Maven</displayName>
<comment>Apache Maven Project Build Tool</comment>
<version>1.0.0</version>
<components>
<component>
<name>MAVEN_CLIENT</name>
<displayName>Maven</displayName>
<category>CLIENT</category>
<commandScript>
<script>scripts/client.py</script>
<scriptType>PYTHON</scriptType>
Page 28 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Service Configuration (myservice-config.xml)
● name – the internal name of property (must be unique)
● value – default value for property
● property-type – e.g. whether property is password (optional)
● description – tool tip help text for property
<configuration>
<property require-input="true">
<name>vnc.password</name>
<value></value>
<property-type>PASSWORD</property-type>
<description>VNC password</description>
</property>
<property>
<name>vnc.geometry</name>
<value>1400x860</value>
<description>VNC screen geometry/resolution</description>
</property>
Page 29 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Service Status Configuration (myservice-env.xml)
● status related parameters (e.g. location of file containing pid of service)
● name – the internal name of property (must be unique)
● value – default value for property
● description – tooltip help text for property
<configuration>
<property>
<name>pid_file</name>
<value>/var/run/ipython-notebook/notebook.pid</value>
<description>Process ID File</description>
</property>
</configuration>
Page 30 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Service Configuration Params (params.py)
Python script to read configuration properties from myservice–config.xml
from resource_management import *
# server configurations
config = Script.get_config()
user = config['configurations']['ipython-config']['ipython.user']
group = config['configurations']['ipython-config']['ipython.group']
Page 31 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Service Status Config Params (status_params.py)
Python script to read status related configuration properties from myservice–
env.xml
from resource_management import *
config = Script.get_config()
pid_file = config['configurations']['ipython-env']['pid_file']
Page 32 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Service master python script (master.py) - simple
If the Ambari service is a just wrapper around a Linux service,
the start/stop/status methods as as easy as…
def start(self, env):
Execute("service myservice start")
def status(self, env):
Execute("service myservice status")
def stop(self, env):
Execute("service myservice stop")
Page 33 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Service master python script (master.py)
● def install – called to install service
● def start – called to start service
● def stop – called to stop the service
● def status – called to get status of service
● def configure – called to configure service
def install(self, env):
#Install packages from metainfo.xml
self.install_packages(env)
self.configure(env)
#code to install service
def start(self, env):
import params
import status_params
#code to start service
def configure(self, env):
import params
env.set_params(params)
#code to re-configure service
def stop(self, env):
import status_params
env.set_params(status_params)
self.configure(env)
Execute (format('kill `cat {stack_pidfile}` >/dev/null 2>&1'))
Execute (format("rm -f {stack_pidfile}"))
def status(self, env):
import status_params
env.set_params(status_params)
check_process_status(status_params.stack_pidfile)
Let’s build some services!
Demo
Page 35 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Demo
• Build a MASTER service
• Ntpd
• Sample CLIENT service walk through
• Maven
• Use VNC service to setup a developer sandbox
• Installs Eclipse, IntelliJ, Maven, Spark
• Real world scenarios
• Data Science: iPython service to easily manage platform for data science on Hadoop
• Security: OpenLDAP, KDC, NSLCD services to easily setup security with minimal CLI work
Ambari Views
Page 37 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Ambari Views Framework
Goal: enable the delivery of custom UI experiences in Ambari Web
Developers can extend the Ambari Web interface
• Views expose custom UI features for Hadoop Services
Ambari Admins can entitle Views to Ambari Web users
• Entitlements framework for controlling access to Views
Page 38 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Views Framework
Views Framework vs. Views
Page 38
Views
Core to Ambari
Built by
Hortonworks,
Community,
Partners
Page 39 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Views Framework
Views Framework vs. Views
Page 39
Views
Core to Ambari
Built by
Hortonworks,
Community,
Partners
Page 40 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
View Components
• Serve client-side assets (such as HTML + JavaScript)
• Expose server-side resources (such as REST endpoints)
VIEW
Client-side
assets
(.js, html)
AMBARI WEB
VIEW
Server-side
resources
(java)
AMBARI SERVER
{rest}
Hadoop
and
other
systems
Page 41 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
View Delivery
1. Develop the View (just like you would for a Web App)
2. Package as a View (basically a WAR)
3. Deploy the View into Ambari
4. Ambari Admins create + configuration view instance(s) and give
access to users + groups
Develop DeployPackage
Create
Instance(s)
Page 42 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Versions and Instances
• Deploy multiple versions and create multiple instances of a view
• Manage accessibility and usage
Page 43 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Choice of Deployment Model
• For Hadoop Operators:
Deploy Views in an Ambari Server that is managing a Hadoop
cluster
• For Data Workers:
Run Views in a “standalone” Ambari Server
Ambari
Server
HADOOP
Store & Process
Ambari
Server
Operators
manage the
cluster, may
have Views
deployed
Data
Workers use
the cluster
and use a
“standalone”
Ambari
Server for
Views
Page 44 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Views REST API
Resource Description
GET /api/v1/views List of available views
GET /api/v1/views/{viewName}/versions List of available view versions
GET /api/v1/views/{viewName}/versions/{version}
/instances
List of view instances in a given version
GET /api/v1/views/{viewName}/versions/{version}
/instances/{instanceName}
Details about a specific view instance.
Page 45 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
View Deployment
Place view-package.jar on Ambari Server
/var/lib/ambari-server/resources/views
Restart Ambari Server to start deployment
ambari-server restart
Deployment registers the view with Ambari and extracts the view
/var/lib/ambari-server/resources/views/work
Once complete, the view is available to create instances
Dev Tip: UI assets in extracted view can be modified w/o restart
Page 46 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Views Framework Terminology
Term Description
View Definition Describes the view resources and core view properties such as name,
version and any necessary configuration properties.
View Package Packages the view client and server assets (and dependencies)
View Deployment Deploying a view into Ambari
View Version A specific version of a view
View Instance An instantiation of a specific view version
Framework Services View context, instance data, configuration properties and events
Page 47 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
View Definition (view.xml)
name – the internal name of the view (must be unique)
label – the public display name of the view
version – the version of the view
parameter – (optional) metadata about view instance properties
resource – (optional) the names of the classes required to support a view sub-
resource
instance – (optional) property sets which define static view instances
<view>
<name>MYVIEW</name>
<label>My View</label>
<version>1.0.0</version>
<parameter>
<name>scope</name>
<description>The scope of the instance
</description>
</parameter>
</view>
Dev Tip: Use Static instances for development
Page 48 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Maven build file (pom.xml)
artifactId – determines name of jar
ambari-views 1.7.0.0 dependency ensures jar not required locally
<modelVersion>4.0.0</modelVersion>
<artifactId> hello-world-view</artifactId>
<packaging>jar</packaging>
<name>Hello World View</name>
<groupId>com.github.hortonworks</groupId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId> ambari-views</artifactId>
<version> 1.7.0.0</version>
</dependency>
Page 49 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
View Package
View Definition: view.xml
Resource / Service classes : JAX-RS annotated
UI classes : html, Servlets deployed as web app (WEB-INF/web.xml).
Application logic : Supporting classes
Dependencies : 3rd party jars or classes
├── WEB-INF
│ └── web.xml
├── org
│ └── apache
│ └── ambari
│ └── view
│ └── weather
│ ├── CityResource.class
│ ├── CityResourceProvider.class
│ ├── CityService.class
│ └── WeatherServlet.class
└── view.xml
view-
package.jar
Page 50 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
View Context
• Available to the view server-side through injection.
• Provides access to instance configuration.
• Provides access to the view and instance attributes.
• Provides access to run time information about the current
execution context, including authenticated user principal.
public interface ViewContext {
public String getUsername();
public String getViewName();
public String getInstanceName();
public Map<String, String> getProperties();
public void putInstanceData(...);
public String getInstanceData(...);
}
Page 51 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Views Demo
Let’s build some views!
Page 52 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Demo
• Build example view with only HTML
• Hello World
• iFrame view
• Sample views with HTML and javascript w/o frameworks
• REST API explorer
• Google map
• Sample views using javascript framework
• HDFS Visualizer
• Sample servlet view (uses java)
• Hive query view
The End & Questions
The End & Questions
This Workshop:
● github: https://github.com/abajwa-hw/ambari-workshops
● blog: http://hortonworks.com/blog/apache-ambari-technical-workshop/
Apache Ambari: http://ambari.apache.org/
● wiki: https://cwiki.apache.org/confluence/display/AMBARI/Ambari
● mail lists: https://ambari.apache.org/mail-lists.html
● issues: https://issues.apache.org/jira/browse/AMBARI
Hortonworks:
● forum: http://hortonworks.com/community/forums/forum/ambari/
● social media: twitter, facebook, slideshare, linkedin, ...
Appendix
Page 56 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Ambari Views: Where Can I Learn More?
https://cwiki.apache.org/confluence/display/AMBARI/Views
https://github.com/apache/ambari/blob/trunk/ambari-views/docs/index.md
https://github.com/apache/ambari/tree/trunk/ambari-views/examples
https://github.com/apache/ambari/tree/trunk/contrib/views
Page 57 © Hortonworks Inc. 2011 – 2014. All Rights Reserved
Ambari Views: Developer resources
https://nodesource.com/blog/your-first-nodejs-package
https://docs.angularjs.org/tutorial/
http://www.jeromecukier.net/blog/2012/09/04/getting-to-hello-world-with-
d3/
http://jsbin.com (e.g. http://jsbin.com/hirirazu/3/edit?html,output)
More sample views:
https://github.com/apache/ambari/tree/trunk/ambari-views/examples

More Related Content

PDF
Hortonworks technical workshop operations with ambari
PPTX
Apache Ambari: Past, Present, Future
PDF
zData BI & Advanced Analytics Platform + 8 Week Pilot Programs
PPTX
Apache Ambari - What's New in 2.4
PDF
Discover.hdp2.2.ambari.final[1]
PDF
Deploying and Managing Hadoop Clusters with AMBARI
PPTX
Ambari Views - Overview
PPTX
Apache Ambari BOF - Overview - Hadoop Summit 2013
Hortonworks technical workshop operations with ambari
Apache Ambari: Past, Present, Future
zData BI & Advanced Analytics Platform + 8 Week Pilot Programs
Apache Ambari - What's New in 2.4
Discover.hdp2.2.ambari.final[1]
Deploying and Managing Hadoop Clusters with AMBARI
Ambari Views - Overview
Apache Ambari BOF - Overview - Hadoop Summit 2013

What's hot (20)

PPTX
Apache Ambari - What's New in 2.1
PPTX
Managing Enterprise Hadoop Clusters with Apache Ambari
PPTX
Managing 2000 Node Cluster with Ambari
PDF
Hortonworks Technical Workshop: Interactive Query with Apache Hive
PPTX
Discover HDP 2.1: Using Apache Ambari to Manage Hadoop Clusters
PPTX
Apache Ambari: Managing Hadoop and YARN
PDF
Hortonworks Technical Workshop: What's New in HDP 2.3
PPTX
YARN Ready - Integrating to YARN using Slider Webinar
PPTX
A First-Hand Look at What's New in HDP 2.3
PDF
HDF: Hortonworks DataFlow: Technical Workshop
PDF
An Overview of Ambari
PDF
Manage Hadoop Cluster with Ambari
PPTX
Apache Ambari - What's New in 2.0.0
PPTX
Apache Hadoop 0.23
PPTX
Apache Ambari - What's New in 2.2
PDF
Hortonworks tech workshop in-memory processing with spark
PPTX
Hortonworks Technical Workshop: HBase For Mission Critical Applications
PPTX
Apache Ambari - What's New in 1.7.0
PPTX
Apache Ambari - HDP Cluster Upgrades Operational Deep Dive and Troubleshooting
PDF
Discover HDP2.1: Apache Storm for Stream Data Processing in Hadoop
Apache Ambari - What's New in 2.1
Managing Enterprise Hadoop Clusters with Apache Ambari
Managing 2000 Node Cluster with Ambari
Hortonworks Technical Workshop: Interactive Query with Apache Hive
Discover HDP 2.1: Using Apache Ambari to Manage Hadoop Clusters
Apache Ambari: Managing Hadoop and YARN
Hortonworks Technical Workshop: What's New in HDP 2.3
YARN Ready - Integrating to YARN using Slider Webinar
A First-Hand Look at What's New in HDP 2.3
HDF: Hortonworks DataFlow: Technical Workshop
An Overview of Ambari
Manage Hadoop Cluster with Ambari
Apache Ambari - What's New in 2.0.0
Apache Hadoop 0.23
Apache Ambari - What's New in 2.2
Hortonworks tech workshop in-memory processing with spark
Hortonworks Technical Workshop: HBase For Mission Critical Applications
Apache Ambari - What's New in 1.7.0
Apache Ambari - HDP Cluster Upgrades Operational Deep Dive and Troubleshooting
Discover HDP2.1: Apache Storm for Stream Data Processing in Hadoop
Ad

Viewers also liked (20)

PDF
Implementing a Data Lake with Enterprise Grade Data Governance
PPTX
A Multi Colored YARN
PPTX
Managing your Hadoop Clusters with Apache Ambari
PDF
Past, Present and Future of Apache Ambari
PDF
Solving Big Data Problems using Hortonworks
PDF
Deep learning with Hortonworks and Apache Spark - Hortonworks technical workshop
PDF
Dataguise hortonworks insurance_feb25
PDF
Hortonworks and Platfora in Financial Services - Webinar
PDF
Hortonworks sqrrl webinar v5.pptx
PDF
YARN webinar series: Using Scalding to write applications to Hadoop and YARN
PDF
C-BAG Big Data Meetup Chennai Oct.29-2014 Hortonworks and Concurrent on Casca...
PDF
Accelerate Big Data Application Development with Cascading and HDP, Hortonwor...
PDF
Leverage Big Data to Enhance Customer Experience in Telecommunications – with...
PPTX
Hortonworks Data In Motion Webinar Series Pt. 2
PPTX
Apache NiFi- MiNiFi meetup Slides
PPSX
Haddop in Business Intelligence
PPTX
Desayuno de arquitectos: Big data en azure
PDF
Prdc2012
PDF
Soldagem 2009 2-emi
PPT
14.05.2012 Social Media Monitoring with Hadoop (Nils Kübler, MeMo News)
Implementing a Data Lake with Enterprise Grade Data Governance
A Multi Colored YARN
Managing your Hadoop Clusters with Apache Ambari
Past, Present and Future of Apache Ambari
Solving Big Data Problems using Hortonworks
Deep learning with Hortonworks and Apache Spark - Hortonworks technical workshop
Dataguise hortonworks insurance_feb25
Hortonworks and Platfora in Financial Services - Webinar
Hortonworks sqrrl webinar v5.pptx
YARN webinar series: Using Scalding to write applications to Hadoop and YARN
C-BAG Big Data Meetup Chennai Oct.29-2014 Hortonworks and Concurrent on Casca...
Accelerate Big Data Application Development with Cascading and HDP, Hortonwor...
Leverage Big Data to Enhance Customer Experience in Telecommunications – with...
Hortonworks Data In Motion Webinar Series Pt. 2
Apache NiFi- MiNiFi meetup Slides
Haddop in Business Intelligence
Desayuno de arquitectos: Big data en azure
Prdc2012
Soldagem 2009 2-emi
14.05.2012 Social Media Monitoring with Hadoop (Nils Kübler, MeMo News)
Ad

Similar to Hortonworks Technical Workshop: Apache Ambari (20)

PPTX
Ambari blueprints-overview
PPTX
Managing Enterprise Hadoop Clusters with Apache Ambari
PPTX
Accumulo Summit 2014: Monitoring Apache Accumulo
PPTX
Streamline Hadoop DevOps with Apache Ambari
PPTX
Apache Ambari - What's New in 1.6.0
PPTX
Simplified Cluster Operation & Troubleshooting
PPTX
Simplified Cluster Operation and Troubleshooting
PPTX
Streamline Hadoop DevOps with Apache Ambari
PPTX
2015 zData Inc. - Apache Ambari Overview
PPTX
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
PPTX
Manage Add-on Services in Apache Ambari
PPTX
Manage Add-On Services with Apache Ambari
PPTX
Streamline Hadoop DevOps with Apache Ambari
PPTX
Streamline Hadoop DevOps with Apache Ambari
PPTX
Streamline Hadoop DevOps with Apache Ambari
PPTX
Ambari hadoop-ops-meetup-2013-09-19.final
PPTX
Ambari Management Packs (Apache Ambari Meetup 2018)
PPTX
Ambari Management Packs (Apache Ambari Meetup 2018)
PPTX
Apache Ambari Stack Extensibility
PPTX
The Future of Apache Ambari
Ambari blueprints-overview
Managing Enterprise Hadoop Clusters with Apache Ambari
Accumulo Summit 2014: Monitoring Apache Accumulo
Streamline Hadoop DevOps with Apache Ambari
Apache Ambari - What's New in 1.6.0
Simplified Cluster Operation & Troubleshooting
Simplified Cluster Operation and Troubleshooting
Streamline Hadoop DevOps with Apache Ambari
2015 zData Inc. - Apache Ambari Overview
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Manage Add-on Services in Apache Ambari
Manage Add-On Services with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
Ambari hadoop-ops-meetup-2013-09-19.final
Ambari Management Packs (Apache Ambari Meetup 2018)
Ambari Management Packs (Apache Ambari Meetup 2018)
Apache Ambari Stack Extensibility
The Future of Apache Ambari

More from Hortonworks (20)

PDF
Hortonworks DataFlow (HDF) 3.3 - Taking Stream Processing to the Next Level
PDF
IoT Predictions for 2019 and Beyond: Data at the Heart of Your IoT Strategy
PDF
Getting the Most Out of Your Data in the Cloud with Cloudbreak
PDF
Johns Hopkins - Using Hadoop to Secure Access Log Events
PDF
Catch a Hacker in Real-Time: Live Visuals of Bots and Bad Guys
PDF
HDF 3.2 - What's New
PPTX
Curing Kafka Blindness with Hortonworks Streams Messaging Manager
PDF
Interpretation Tool for Genomic Sequencing Data in Clinical Environments
PDF
IBM+Hortonworks = Transformation of the Big Data Landscape
PDF
Premier Inside-Out: Apache Druid
PDF
Accelerating Data Science and Real Time Analytics at Scale
PDF
TIME SERIES: APPLYING ADVANCED ANALYTICS TO INDUSTRIAL PROCESS DATA
PDF
Blockchain with Machine Learning Powered by Big Data: Trimble Transportation ...
PDF
Delivering Real-Time Streaming Data for Healthcare Customers: Clearsense
PDF
Making Enterprise Big Data Small with Ease
PDF
Webinewbie to Webinerd in 30 Days - Webinar World Presentation
PDF
Driving Digital Transformation Through Global Data Management
PPTX
HDF 3.1 pt. 2: A Technical Deep-Dive on New Streaming Features
PDF
Hortonworks DataFlow (HDF) 3.1 - Redefining Data-In-Motion with Modern Data A...
PDF
Unlock Value from Big Data with Apache NiFi and Streaming CDC
Hortonworks DataFlow (HDF) 3.3 - Taking Stream Processing to the Next Level
IoT Predictions for 2019 and Beyond: Data at the Heart of Your IoT Strategy
Getting the Most Out of Your Data in the Cloud with Cloudbreak
Johns Hopkins - Using Hadoop to Secure Access Log Events
Catch a Hacker in Real-Time: Live Visuals of Bots and Bad Guys
HDF 3.2 - What's New
Curing Kafka Blindness with Hortonworks Streams Messaging Manager
Interpretation Tool for Genomic Sequencing Data in Clinical Environments
IBM+Hortonworks = Transformation of the Big Data Landscape
Premier Inside-Out: Apache Druid
Accelerating Data Science and Real Time Analytics at Scale
TIME SERIES: APPLYING ADVANCED ANALYTICS TO INDUSTRIAL PROCESS DATA
Blockchain with Machine Learning Powered by Big Data: Trimble Transportation ...
Delivering Real-Time Streaming Data for Healthcare Customers: Clearsense
Making Enterprise Big Data Small with Ease
Webinewbie to Webinerd in 30 Days - Webinar World Presentation
Driving Digital Transformation Through Global Data Management
HDF 3.1 pt. 2: A Technical Deep-Dive on New Streaming Features
Hortonworks DataFlow (HDF) 3.1 - Redefining Data-In-Motion with Modern Data A...
Unlock Value from Big Data with Apache NiFi and Streaming CDC

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
KodekX | Application Modernization Development
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Monthly Chronicles - July 2025
Review of recent advances in non-invasive hemoglobin estimation
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The Rise and Fall of 3GPP – Time for a Sabbatical?
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Monthly Chronicles - July 2025

Hortonworks Technical Workshop: Apache Ambari

  • 1. Apache Ambari Workshop Stacks, Blueprints, Views We Do Hadoop Ajay Singh, Ali Bajwa, Sean Roberts Partner Solution Engineering March-2015
  • 2. Who Ajay Singh - Director - ajaysingh@hortonworks.com Ali Bajwa - Engineer - abajwa@hortonworks.com Sean Roberts - Engineer, London & EMEA - @seano
  • 3. Schedule ● Ambari Overview ● Stacks ● Blueprints ● Stack Services ● Views
  • 4. Page 4 © Hortonworks Inc. 2011 – 2015. All Rights Reserved How do you Operate a Hadoop Cluster? Apache Ambari is a platform to provision, manage and monitor Hadoop clusters
  • 5. Page 5 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Apache Ambari Themes Operate Hadoop at Scale Deliver the core operational capabilities to provision, manage and monitor Hadoop clusters at scale. Integrate with the Enterprise Robust API for integration with existing enterprise systems, such as Teradata Viewpoint and Microsoft SCOM. Extend for the Ecosystem Provide extensible platform for Customers, Partners and the Community to, such as Stacks and Views.
  • 6. Page 6 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Hadoop Operations Platform Apache Ambari is a 100% open source platform for provisioning, managing and monitoring Apache Hadoop clusters AMBARI WEB Others compute & storage . . . . . . . . compute & storage . .EXTEND AMBARI REST API AMBARI SERVER PROVISION | MANAGE | MONITOR Integration with Existing Tools OPERATE AMBARI STACKS
  • 7. Page 7 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Innovation at the Speed of Community An active 100% open source Community: • 90+ Contributors / 45+ Committers • 270+ Ambari User Group Members 2014 Dec Graduates to Apache Top Level Project 2013 Dec Apache Ambari 1.7 Released Adds support for Hortonworks Data Platform 2.2 Adds new operational and extensibility capabilities
  • 8. Page 8 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Recent Ambari Releases Ambari 1.6.0 May 2014 Ambari 1.5.1 Apr 2014 Ambari 1.5.0 Apr 2014 Ambari 1.6.1 Jul 2014 Introduced Ambari Stacks Introduced Ambari Blueprints HDP 2.1 GA Ambari 1.7.0 Dec 2014 HDP 2.2 GA Introduced Ambari Views
  • 9. Page 9 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Extensibility Features • To add new Services (ISV or otherwise) beyond HDP Stack • To customize a Stack for customer specific environments • To use Ambari for automating cluster installations • To share best practices on layout and cluster configuration • To extend and customize the Ambari Web UI • Add new capabilities, customize existing capabilities Stacks Blueprints Views Goal: Extend Ambari without hard-coding in Ambari 1.5.0 1.7.0 1.6.0
  • 10. Page 10 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Anatomy of Ambari Extension Points Ambari Server Ambari AgentAmbari AgentAmbari Agent Ambari Web Stacks Stacks Stacks javajs python Ambari Views Ambari Stacks Ambari Blueprints Ambari API
  • 11. Page 11 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Partners Integrating With Ambari
  • 12. Ambari Community Apache Ambari: http://ambari.apache.org ● wiki: https://cwiki.apache.org/confluence/display/AMBARI/Ambari ● mail lists: https://ambari.apache.org/mail-lists.html ● issues: https://issues.apache.org/jira/browse/AMBARI Hortonworks: ● forum: http://hortonworks.com/community/forums/forum/ambari/ ● social media: twitter, facebook, slideshare, linkedin, ...
  • 13. Partner Resources This Workshop: ● github: http://git.io/jmz4 (https://github.com/abajwa-hw/ambari-workshops) ● blog: http://hortonworks.com/blog/apache-ambari-technical-workshop/ Past & Future Workshops: ● http://hortonworks.com/partners/learn/ Upcoming meetups and events: ● http://hortonworks.com/events/
  • 15. Page 15 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Stack Terminology Term Definition Examples STACK Defines a set of Services, where to obtain the software packages and how to manage the lifecycle. HDP-2.0, HDP-1.3.3 SERVICE Defines the Components that make-up the Service. HDFS, NAGIOS, YARN COMPONENT The building-blocks of a Service, that adhere to a certain lifecycle. NAMENODE, DATANODE, OOZIE_SERVER CATEGORY The category of Component. MASTER, SLAVE, CLIENT
  • 16. Page 16 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Stack Mechanics Stacks define Services + Repos What is in the Stack, and where to get the bits Each Service has a definition What Components are part of the Service Each Service has defined lifecycle commands start, stop, status, install, configure Lifecycle is controlled via command scripts Ability to define “custom” commands AMBARI SERVER Stack Command Scripts Service Definitions AMBARI AGENT/S AMBARI AGENT/S AMBARI AGENT/S pythonxml Repos
  • 17. Page 17 © Hortonworks Inc. 2011 – 2015. All Rights Reserved Stacks Support Inheritance HDP 2.0 Stack HDP 2.1 Stack • Defines a set of Service definitions • Default service configurations and command scripts • Overrides any Service definitions, commands and configurations • Adds new Services specific to this Stack
  • 18. Deploying clusters of any scale with ease Ambari Blueprints
  • 19. Before Ambari ● Manual installation ● Manual configuration ● Manual distribution of configuration ● XML ● XML ● XML ...
  • 20. Manual Install with Ambari Wizard
  • 21. Automation with Ambari Blueprints Stack Definition Component Layout & Configuration BLUEPRINT BLUEPRINT INSTANTIATE CLUSTER
  • 22. 2 HTTP calls for a Deployed Cluster { "Blueprints": { "stack_name": "HDP", "stack_version": "2.2" }, "host_groups": [ { "name": "workers", "components": [ { "name": "DATANODE" }, { "name": "JOURNALNODE" }, { … … } }, { "name": "master-1", "components": [ { "name": "NAMENODE" }, { … … } } ]} { "Blueprints": { "blueprint": "myblueprint", "default_password": "awesome", "configurations": [ { "hive-site": { "properties": { "hive.execution.engine": "tez" }}}], "host_groups": [ { "name": "master-1", "hosts": [ { "fqdn": "hdp00" } ]}, { "name": "workers" "hosts": [ { "fqdn": "hdp01" }, { "fqdn": "hdp01" }, { "fqdn": "hdp.." }, { "fqdn": "hdp99" }]} ]} 1) POST /api/v1/blueprints/myblueprint 2) POST /api/v1/clusters/mycluster
  • 23. Export Cluster to Blueprint GET /api/v1/clusters/my_cluster?format=blueprint { "configurations" : [ { "cluster-env" : { "cluster_name" : "sandbox", ... }}, { "hive-site" : { "hive.execution.engine" : "tez", ... }} ], "host_groups" : [ { "name" : "host_group_1", "configurations" : [ ], "components" : [ { "name" : "NAMENODE" }, { "name" : "HIVE_SERVER"}, ... ], "cardinality" : "1" }], "Blueprints" : { "stack_name" : "HDP", "stack_version" : "2.2" } }
  • 24. Live Demo Command snippets: http://nbviewer.ipython.org/github/seanorama/ambari- bootstrap/blob/master/api-examples/ambari-workshop-blueprints.ipynb For API examples including Python versions in an ipython notebook: https://github.com/seanorama/ambari-bootstrap/tree/master/api-examples
  • 26. Page 26 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Files needed to create an Ambari service • Service definition file (metainfo.xml) • Service configuration file (myservice-config.xml) • Service configuration parameters (params.py) • Service master python script (master.py) Not always needed: • Service status configuration file (myservice-env.xml) • Service status configuration parameters (status_params.py)
  • 27. Page 27 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Service Definition (metainfo.xml) ● name – the internal name of the service (must be unique) ● displayName – the public display name of the service ● version – the version of the service ● component category – is the component a MASTER or CLIENT (one or more) ● script – the script that will be executed during service install, start, stop ● package – packages to be installed via yum during install <service> <name>MAVEN</name> <displayName>Maven</displayName> <comment>Apache Maven Project Build Tool</comment> <version>1.0.0</version> <components> <component> <name>MAVEN_CLIENT</name> <displayName>Maven</displayName> <category>CLIENT</category> <commandScript> <script>scripts/client.py</script> <scriptType>PYTHON</scriptType>
  • 28. Page 28 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Service Configuration (myservice-config.xml) ● name – the internal name of property (must be unique) ● value – default value for property ● property-type – e.g. whether property is password (optional) ● description – tool tip help text for property <configuration> <property require-input="true"> <name>vnc.password</name> <value></value> <property-type>PASSWORD</property-type> <description>VNC password</description> </property> <property> <name>vnc.geometry</name> <value>1400x860</value> <description>VNC screen geometry/resolution</description> </property>
  • 29. Page 29 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Service Status Configuration (myservice-env.xml) ● status related parameters (e.g. location of file containing pid of service) ● name – the internal name of property (must be unique) ● value – default value for property ● description – tooltip help text for property <configuration> <property> <name>pid_file</name> <value>/var/run/ipython-notebook/notebook.pid</value> <description>Process ID File</description> </property> </configuration>
  • 30. Page 30 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Service Configuration Params (params.py) Python script to read configuration properties from myservice–config.xml from resource_management import * # server configurations config = Script.get_config() user = config['configurations']['ipython-config']['ipython.user'] group = config['configurations']['ipython-config']['ipython.group']
  • 31. Page 31 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Service Status Config Params (status_params.py) Python script to read status related configuration properties from myservice– env.xml from resource_management import * config = Script.get_config() pid_file = config['configurations']['ipython-env']['pid_file']
  • 32. Page 32 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Service master python script (master.py) - simple If the Ambari service is a just wrapper around a Linux service, the start/stop/status methods as as easy as… def start(self, env): Execute("service myservice start") def status(self, env): Execute("service myservice status") def stop(self, env): Execute("service myservice stop")
  • 33. Page 33 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Service master python script (master.py) ● def install – called to install service ● def start – called to start service ● def stop – called to stop the service ● def status – called to get status of service ● def configure – called to configure service def install(self, env): #Install packages from metainfo.xml self.install_packages(env) self.configure(env) #code to install service def start(self, env): import params import status_params #code to start service def configure(self, env): import params env.set_params(params) #code to re-configure service def stop(self, env): import status_params env.set_params(status_params) self.configure(env) Execute (format('kill `cat {stack_pidfile}` >/dev/null 2>&1')) Execute (format("rm -f {stack_pidfile}")) def status(self, env): import status_params env.set_params(status_params) check_process_status(status_params.stack_pidfile)
  • 34. Let’s build some services! Demo
  • 35. Page 35 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Demo • Build a MASTER service • Ntpd • Sample CLIENT service walk through • Maven • Use VNC service to setup a developer sandbox • Installs Eclipse, IntelliJ, Maven, Spark • Real world scenarios • Data Science: iPython service to easily manage platform for data science on Hadoop • Security: OpenLDAP, KDC, NSLCD services to easily setup security with minimal CLI work
  • 37. Page 37 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Ambari Views Framework Goal: enable the delivery of custom UI experiences in Ambari Web Developers can extend the Ambari Web interface • Views expose custom UI features for Hadoop Services Ambari Admins can entitle Views to Ambari Web users • Entitlements framework for controlling access to Views
  • 38. Page 38 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Views Framework Views Framework vs. Views Page 38 Views Core to Ambari Built by Hortonworks, Community, Partners
  • 39. Page 39 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Views Framework Views Framework vs. Views Page 39 Views Core to Ambari Built by Hortonworks, Community, Partners
  • 40. Page 40 © Hortonworks Inc. 2011 – 2014. All Rights Reserved View Components • Serve client-side assets (such as HTML + JavaScript) • Expose server-side resources (such as REST endpoints) VIEW Client-side assets (.js, html) AMBARI WEB VIEW Server-side resources (java) AMBARI SERVER {rest} Hadoop and other systems
  • 41. Page 41 © Hortonworks Inc. 2011 – 2014. All Rights Reserved View Delivery 1. Develop the View (just like you would for a Web App) 2. Package as a View (basically a WAR) 3. Deploy the View into Ambari 4. Ambari Admins create + configuration view instance(s) and give access to users + groups Develop DeployPackage Create Instance(s)
  • 42. Page 42 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Versions and Instances • Deploy multiple versions and create multiple instances of a view • Manage accessibility and usage
  • 43. Page 43 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Choice of Deployment Model • For Hadoop Operators: Deploy Views in an Ambari Server that is managing a Hadoop cluster • For Data Workers: Run Views in a “standalone” Ambari Server Ambari Server HADOOP Store & Process Ambari Server Operators manage the cluster, may have Views deployed Data Workers use the cluster and use a “standalone” Ambari Server for Views
  • 44. Page 44 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Views REST API Resource Description GET /api/v1/views List of available views GET /api/v1/views/{viewName}/versions List of available view versions GET /api/v1/views/{viewName}/versions/{version} /instances List of view instances in a given version GET /api/v1/views/{viewName}/versions/{version} /instances/{instanceName} Details about a specific view instance.
  • 45. Page 45 © Hortonworks Inc. 2011 – 2014. All Rights Reserved View Deployment Place view-package.jar on Ambari Server /var/lib/ambari-server/resources/views Restart Ambari Server to start deployment ambari-server restart Deployment registers the view with Ambari and extracts the view /var/lib/ambari-server/resources/views/work Once complete, the view is available to create instances Dev Tip: UI assets in extracted view can be modified w/o restart
  • 46. Page 46 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Views Framework Terminology Term Description View Definition Describes the view resources and core view properties such as name, version and any necessary configuration properties. View Package Packages the view client and server assets (and dependencies) View Deployment Deploying a view into Ambari View Version A specific version of a view View Instance An instantiation of a specific view version Framework Services View context, instance data, configuration properties and events
  • 47. Page 47 © Hortonworks Inc. 2011 – 2014. All Rights Reserved View Definition (view.xml) name – the internal name of the view (must be unique) label – the public display name of the view version – the version of the view parameter – (optional) metadata about view instance properties resource – (optional) the names of the classes required to support a view sub- resource instance – (optional) property sets which define static view instances <view> <name>MYVIEW</name> <label>My View</label> <version>1.0.0</version> <parameter> <name>scope</name> <description>The scope of the instance </description> </parameter> </view> Dev Tip: Use Static instances for development
  • 48. Page 48 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Maven build file (pom.xml) artifactId – determines name of jar ambari-views 1.7.0.0 dependency ensures jar not required locally <modelVersion>4.0.0</modelVersion> <artifactId> hello-world-view</artifactId> <packaging>jar</packaging> <name>Hello World View</name> <groupId>com.github.hortonworks</groupId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.apache.ambari</groupId> <artifactId> ambari-views</artifactId> <version> 1.7.0.0</version> </dependency>
  • 49. Page 49 © Hortonworks Inc. 2011 – 2014. All Rights Reserved View Package View Definition: view.xml Resource / Service classes : JAX-RS annotated UI classes : html, Servlets deployed as web app (WEB-INF/web.xml). Application logic : Supporting classes Dependencies : 3rd party jars or classes ├── WEB-INF │ └── web.xml ├── org │ └── apache │ └── ambari │ └── view │ └── weather │ ├── CityResource.class │ ├── CityResourceProvider.class │ ├── CityService.class │ └── WeatherServlet.class └── view.xml view- package.jar
  • 50. Page 50 © Hortonworks Inc. 2011 – 2014. All Rights Reserved View Context • Available to the view server-side through injection. • Provides access to instance configuration. • Provides access to the view and instance attributes. • Provides access to run time information about the current execution context, including authenticated user principal. public interface ViewContext { public String getUsername(); public String getViewName(); public String getInstanceName(); public Map<String, String> getProperties(); public void putInstanceData(...); public String getInstanceData(...); }
  • 51. Page 51 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Views Demo Let’s build some views!
  • 52. Page 52 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Demo • Build example view with only HTML • Hello World • iFrame view • Sample views with HTML and javascript w/o frameworks • REST API explorer • Google map • Sample views using javascript framework • HDFS Visualizer • Sample servlet view (uses java) • Hive query view
  • 53. The End & Questions
  • 54. The End & Questions This Workshop: ● github: https://github.com/abajwa-hw/ambari-workshops ● blog: http://hortonworks.com/blog/apache-ambari-technical-workshop/ Apache Ambari: http://ambari.apache.org/ ● wiki: https://cwiki.apache.org/confluence/display/AMBARI/Ambari ● mail lists: https://ambari.apache.org/mail-lists.html ● issues: https://issues.apache.org/jira/browse/AMBARI Hortonworks: ● forum: http://hortonworks.com/community/forums/forum/ambari/ ● social media: twitter, facebook, slideshare, linkedin, ...
  • 56. Page 56 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Ambari Views: Where Can I Learn More? https://cwiki.apache.org/confluence/display/AMBARI/Views https://github.com/apache/ambari/blob/trunk/ambari-views/docs/index.md https://github.com/apache/ambari/tree/trunk/ambari-views/examples https://github.com/apache/ambari/tree/trunk/contrib/views
  • 57. Page 57 © Hortonworks Inc. 2011 – 2014. All Rights Reserved Ambari Views: Developer resources https://nodesource.com/blog/your-first-nodejs-package https://docs.angularjs.org/tutorial/ http://www.jeromecukier.net/blog/2012/09/04/getting-to-hello-world-with- d3/ http://jsbin.com (e.g. http://jsbin.com/hirirazu/3/edit?html,output) More sample views: https://github.com/apache/ambari/tree/trunk/ambari-views/examples