Versions Compared

Key

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

...

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.

Info

The below multi-nodeexample cluster creation template example uses the "host_count" and "host_predicate" syntax for the "slave" host group which is available as of Ambari 2.1.0. For older versions of Ambari, the "hosts/fqdn" syntax must be used.

...

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/MyThreeNodeCluster/requests/1",
  "Requests" : {
    "id" : 1,
    "status" : "InProgress"
  }
}

Adding Hosts to an Existing Cluster 

After creating a cluster using the Ambari Blueprint API, you may scale up the cluster using the API.

There are two forms of the API, one for adding a single host and another for adding multiple hosts.

Info

The blueprint add hosts API is available as of Ambari 2.0.

Currently, only clusters originally provisioned via the blueprint API may be scaled using this API.

Example Add Host Template
Single Host Example

Host is specified in URL

Code Block
{
  "blueprint" : "multi-node-hdfs-yarn",
  "host_group" : "slaves"    
}
Multiple Host Form

Host is specified in request body

Code Block
[
  {
    "blueprint" : "multi-node-hdfs-yarn",
    "host_group" : "slaves",
    "host_name" : "c6403.ambari.apache.org"
  },
  {
    "blueprint" : "multi-node-hdfs-yarn",
    "host_group" : "slaves",
    "host_name" : "c6404.ambari.apache.org"
  }
]
Multiple Host Form using host_count

Starting with Ambari 2.1, the fields "host_count" and "host_predicate" can also be used when adding a host.

These fields behave exactly the same as they do when specified in the cluster creation template.

Code Block
[
  {
    "blueprint" : "multi-node-hdfs-yarn",
    "host_group" : "slaves",
    "host_count" : 5,
    "host_predicate" : "Hosts/os_type=centos6&Hosts/cpu_count=2"
  }
]
Add Host Request
Single Host
Code Block
POST /api/v1/clusters/myExistingCluster/hosts/c6403.ambari.apache.org
...
[ Request Body is above Single Host Add Host Template ]
...

202 - Accepted
{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/myExistingCluster/requests/1",
  "Requests" : {
    "id" : 1,
    "status" : "Pending"
  }
}
Multiple Hosts
Code Block
POST /api/v1/clusters/myExistingCluster/hosts
...
[ Request Body is above Multiple Host Add Host Template ]
...

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

 

Blueprint Support for High Availability Clusters

...