Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Ambari Blueprints are a declarative definition of a cluster. With a Blueprint, you specify a Stack, the Component layout and the Configurations to materialize a Hadoop cluster instance (via a REST API) without having to use the Ambari Cluster Install Wizard.

toc 

Notable JIRAs
JIRADescription
AMBARI-4467Blueprints REST resource.
AMBARI-5077Provision cluster with blueprint.
AMBARI-4786Export blueprints from running/existing cluster.
AMBARI-5114Configurations with blueprints.

...

Table of Contents

API Resources and Syntax

The following table lists the basic Blueprints API resources.

ResourceDescription
GET /blueprintsReturns the available blueprints.
POST /blueprints/:nameCreates a blueprint.
POST /clusters/:nameCreates a cluster.
GET /clusters/:name?format=blueprintExport the current cluster layout as a blueprint.
Info

The API calls on this wiki page include the HTTP Method (for example: GET, PUT, POST) and a sample URI (for example: /api/v1/blueprints) . When actually calling the Ambari REST API, you want to be sure to set the X-Requested-By header and provide authentication information as appropriate.

curl -H "X-Requested-By: ambari" -X GET -u admin:admin http://c6401.ambari.apache.org:8080/api/v1/blueprints

Blueprint Usage Overview

Step 0: Prepare Ambari Server and Agents 

...

Using the /requests URL returned in Step 4, monitor the progress of the tasks associated with cluster creation.

Blueprint Details

Prepare Ambari Server and Agents

...

  • Not all configuration properties have valid defaults
  • Required properties must be specified by the Blueprint user
  • Come in two categories, passwords and non passwords
  • Non password required properties are validated at Blueprint creation time
  • Required password properties are validated at cluster creation time
  • For required password properties, they may be explicitly set in either the Blueprint or Cluster Creation Template configurations or a default password may be specified in the Cluster Creation Template which will be applied to all passwords which have not been explicitly set
    • "default_password" : "super-secret-password"
  • If required configuration validation fails, a 400 response is returned indicating which properties must be specified

Blueprint Example: Single-Node HDP 2.0 Cluster

  • Single-node cluster (c6401.ambari.apache.org)
  • HDP 2.0 Stack
  • Install Core Hadoop Services (HDFS, YARN, MapReduce2, ZooKeeper) + Ganglia (metrics) and Nagios (alerts)

...

Code Block
POST /api/v1/clusters/MySingleNodeCluster

...
[ Request Body is above Cluster Creation Template ]
...

202 - Accepted
{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/MyCluster/requests/1",
  "Requests" : {
    "id" : 1,
    "status" : "InProgress"
  }
}

Blueprint Example: Multi-Node HDP 2.0 Cluster

  • Multi-node cluster (three hosts)
  • Host Groups: “master”, “slaves” (one master host, two slave hosts)
  • Use HDP 2.0 Stack
  • Install Core Hadoop Services (HDFS, YARN, MapReduce2, ZooKeeper) + Ganglia (metrics) and Nagios (alerts)

...

Code Block
POST /api/v1/clusters/MyThreeNodeCluster
...
[ Request Body is above Cluster Creation Template ]
...

202 - Accepted
{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/MyCluster/requests/1",
  "Requests" : {
    "id" : 1,
    "status" : "InProgress"
  }
}