Leveraging Ambari to Build Comprehensive Management UIs For Your Hadoop Applications
by Christian Tzolov @christzolov
Leveraging Ambari to Build Comprehensive Management UIs For Your - - PowerPoint PPT Presentation
Leveraging Ambari to Build Comprehensive Management UIs For Your Hadoop Applications by Christian Tzolov @christzolov Whoami Christian Tzolov Technical Architect at Pivotal, BigData, Hadoop, SpringXD, Apache Committer, Crunch PMC member
by Christian Tzolov @christzolov
Christian Tzolov Technical Architect at Pivotal, BigData, Hadoop, SpringXD, Apache Committer, Crunch PMC member ctzolov@pivotal.io blog.tzolov.net @christzolov
A platform to provision, manage and monitor Hadoop and Enterprise Applications
Ambari Web (REST API) Ambari Server
admin node
Ambari Agent
cluster node 1
Ambari Agent
cluster node 2
Ambari Agent
cluster node N
Services & Stacks Blueprints Views Monitoring
packages for them
Master, Slave, Client
|_ services |_ <service_name> metainfo.xml metrics.json |_ configuration {configuration files} |_ package |_ scripts {command scripts}
components and the command management scripts
files used in and deployed through the command scripts
commandScripts and templates.
<metainfo> <schemaVersion/> <services> <service> <name/> <displayName/> <comment/> <version/> <components/> <osSpecifics/> <commandScript/> <requiredServices/> <configuration-dependencies/> </service> </services> </metainfo>
<components> <component> <name>CUST_MASTER</name> <displayName>Master</displayName> <category>MASTER</category> <cardinality>1</cardinality> <commandScript> <script>scripts/master.py</script> <scriptType>PYTHON</scriptType> <timeout>600</timeout> </commandScript> </component> ……… </components>
import sys from resource_management import * class Master(Script): def install(self, env): def stop(self, env): def start(self, env): def status(self, env): def configure(self, env): if __name__ == "__main__": Master().execute() import sys from resource_management import * class Slave(Script): def install(self, env): def stop(self, env): def start(self, env): def status(self, env): def configure(self, env): if __name__ == "__main__": Slave().execute()
Configurations to materialize a cluster
Ambari Server node 1
Cluster 1
node 2 node N
Cluster 2
. . . .
Cluster Z
. . . . Blueprint (json) Host Mapping (json)
REST API
{ "Blueprints" : { "stack_name" : "PHD", "stack_version" : "3.0" }, "configurations" : [ { "hawq-site" : { "properties" : { "hawq.master.port" : "5532" } } } ], "host_groups" : [ { "name" : "management_masters", "components" : [ { "name" : "NAMENODE" }, { "name" : "HAWQMASTER" } ], "cardinality" : "1" }, …… ]} POST /api/v1/blueprints/my-blueprint { "blueprint" : "hdfs-hawq-blueprint", "default_password" : "secret-password", "host_groups" : [ { "name" : "management_masters", "hosts": [ { "fqdn":"ambari.localdomain" } ] }, { "name" : "masters_workers", "hosts": [ { "fqdn":"phd1.localdomain" }, { "fqdn":"phd2.localdomain" }, { "fqdn":"phd3.localdomain" } ] } ] } POST /api/v1/clusters/my-cluster
/api/v1/blueprint Cluster Logical Structure and configuration /api/v1/cluster Physical cluster mapping. Materializes a blueprint with real infrastructure /api/v1/clusters/<cluster name>? format=blueprint Exports blueprint for an existing cluster
Ambari Server Ambari Web Server Side (java) Client Side (js,html..)
REST API VIEW PACKAGE (JAR)
technologies
Servlet, a REST service or ResourceProvider.
the view definition and resources
attributes and configuration
context
view.xml <server packages + classes> index.html <supporting UI assets> WEB-INF (lib/*.jar)
ViewContext getUsername() : String getViewName() : String getInstanceName() : String getProperties() : Map<String,String> putInstanceData(…) getInstanceData(…) : String
GET /api/v1/views List deployed views GET /api/v1/views/<View Name> List all View instances GET /api/v1/views/<View Name>/versions/<View Version> Show specific View instance POST /api/v1/views/<View Name>/versions/<View Version>/instances/<Instance Name>
[{“ViewInstanceInfo":{ "properties" : { "dataworker.defaultFs":“webhdfs://namenode.host:50070" }}}]
Create new View Instance
https://www.polymer-project.org/1.0/
https://github.com/tzolov/ambari-webpage- embedder-view https://youtu.be/qaR_6OBeKsQ
Collect, Aggregate and Serve System Metrics
(https://github.com/tzolov/ vagrant-pivotalhd)
(http://sequenceiq.com/ cloudbreak/)