Ambari Blueprints are a declarative definition of a cluster. With a Blueprint, you specify a Stack and a Component layout to materialize a Hadoop cluster instance without having to use the Ambari Cluster Install Wizard.
Key JIRAs
JIRA | Description |
---|---|
AMBARI-4467 | Blueprints REST resource. |
AMBARI-5077 | Provision cluster with blueprint. |
AMBARI-4786 | Export blueprints from running/existing cluster. |
AMBARI-5114 | Configurations with blueprints. |
Basic API Resources
Resource | Description |
---|---|
GET /blueprints | Returns the available blueprints. |
POST /blueprints/:name | Creates a blueprint. |
POST /clusters/:name | Creates a cluster. |
GET /clusters/:name?format=blueprint | Export the current cluster layout as a blueprint. |
Example: Single-Node Cluster
- Single-node cluster (c6401.ambari.apache.org)
- HDP 2.0 Stack
- Install Core Hadoop Services (HDFS, YARN, MapReduce2, ZooKeeper)
Step 0: Prepare Ambari Server and Ambari Agent
Install the Ambari Server, run setup and start. Install the Ambari Agent and perform manual registration.
Step 1: Define your blueprint
The blueprint ("single-node-hdfs-yarn") below defines with one host group ("host_group_1") which hosts all the components (masters, slaves and clients).
Code Block |
---|
{
"host_groups" : [
{
"name" : "host_group_1",
"components" : [
{
"name" : "NAMENODE"
},
{
"name" : "SECONDARY_NAMENODE"
},
{
"name" : "DATANODE"
},
{
"name" : "HDFS_CLIENT"
},
{
"name" : "RESOURCEMANAGER"
},
{
"name" : "NODEMANAGER"
},
{
"name" : "YARN_CLIENT"
},
{
"name" : "HISTORYSERVER"
},
{
"name" : "MAPREDUCE2_CLIENT"
},
{
"name" : "ZOOKEEPER_SERVER"
},
{
"name" : "ZOOKEEPER_CLIENT"
}
],
"cardinality" : "1"
}
],
"Blueprints" : {
"blueprint_name" : "single-node-hdfs-yarn",
"stack_name" : "HDP",
"stack_version" : "2.0"
}
} |
Step 2: Create blueprint in Ambari Server
Post the blueprint to the "single-node-hdfs-yarn" resource to the Ambari Server.
Code Block |
---|
POST /api/v1/blueprints/single-node-hdfs-yarn |
Step 3: Map hosts to blueprint + host groups for the cluster instance
We are performing a single-node install and the blueprint above has one host group. Therefore, for our cluster instance, we define one host in host_group_1 and reference the single-node-hdfs-yarn blueprint.
Code Block |
---|
{
"blueprint" : "single-node-hdfs-yarn",
"host-groups" :[
{
"name" : "host_group_1",
"hosts" : [
{
"fqdn" : "c6401.ambari.apache.org",
"ip" : "192.168.100.0"
}
]
}
]
} |
Step 4: Create cluster instance with blueprint
Post the cluster to the Ambari Server to provision the cluster.
Code Block |
---|
POST /api/v1/cluster/MyCluster |
Example: Three-Node Cluster
- Three-node cluster
- Host Groups: “master”, “slaves”
- Use HDP 2.0 Stack
- Install Core Hadoop Services (HDFS, YARN, MapReduce2, ZooKeeper)
TBD