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.
...
Table of Contents |
---|
Notable 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. |
...
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. |
Preparing Your Ambari Server and Agents
- Perform your Ambari Server install and setup.
- Start your Ambari Server.
- Install Ambari Agents on the hosts you plan to include in your cluster.
- Set the Ambari Server hostname on the Ambari Agents and start the Agents to perform manual registration.
- Proceed with defining your blueprint and creating a cluster instance from that blueprint.
Example: Single-Node Cluster
...
Code Block |
---|
POST /api/v1/cluster/MyClusterMySingleNodeCluster |
Example:
...
Multi-Node Cluster
- ThreeMulti-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)
...
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 ("multi-node-hdfs-yarn") below defines with two host groups ("masters" and "slaves") which hosts the various Service components (masters, slaves and clients).
Code Block |
---|
{
"host_groups" : [
{
"name" : "masters",
"components" : [
{
"name" : "NAMENODE"
},
{
"name" : "SECONDARY_NAMENODE"
},
{
"name" : "RESOURCEMANAGER"
},
{
"name" : "HISTORYSERVER"
},
{
"name" : "NAGIOS_SERVER"
},
{
"name" : "ZOOKEEPER_SERVER"
}
],
"cardinality" : "1"
},
{
"name" : "slaves",
"components" : [
{
"name" : "DATANODE"
},
{
"name" : "HDFS_CLIENT"
},
{
"name" : "NODEMANAGER"
},
{
"name" : "YARN_CLIENT"
},
{
"name" : "MAPREDUCE2_CLIENT"
},
{
"name" : "ZOOKEEPER_CLIENT"
}
],
"cardinality" : "2"
}
],
"Blueprints" : {
"blueprint_name" : "multi-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/multi-node-hdfs-yarn |
Step 3: Map hosts to blueprint + host groups for the cluster instance
We are performing a multi-node install and the blueprint above has two host groups. Therefore, for our cluster instance, we define one host in masters, two hosts in slaves and reference the multi-node-hdfs-yarn blueprint.
Code Block |
---|
{
"blueprint" : "two-node-hdfs-yarn-test",
"host-groups" :[
{
"name" : "masters",
"hosts" : [
{
"fqdn" : "c6401.ambari.apache.org",
"ip" : "192.168.100.0"
}
]
},
{
"name" : "slaves",
"hosts" : [
{
"fqdn" : "c6402.ambari.apache.org",
"ip" : "192.168.100.0"
},
{
"fqdn" : "c6403.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/MyThreeNodeCluster |