Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Allow a cluster to be fully provisioned via the Ambari REST API with a single REST API call by specifying a blueprint name. This means that from a single, simple asynchronous REST API call, a cluster can now be provisioned from INIT->STARTED.
The process to provision a cluster via the REST API using blueprints is as follows:
- Create a blueprint resource instance on the Ambari instance which is going to be used to provision the cluster. The blueprint may have been hand created or exported from a running cluster.
POST myAmbariServer:8080/api/v1/blueprints/single-node-test
{ "host_groups" : [ { "name" : "host_group_1", "components" : [ { "name" : "HISTORYSERVER" }, { "name" : "JOBTRACKER" }, { "name" : "NAMENODE" }, { "name" : "OOZIE_SERVER" }, { "name" : "NAGIOS_SERVER" }, { "name" : "SECONDARY_NAMENODE" }, { "name" : "AMBARI_SERVER" }, { "name" : "GANGLIA_SERVER" }, { "name" : "GANGLIA_MONITOR" }, { "name" : "DATANODE" }, { "name" : "TASKTRACKER" }, { "name" : "HDFS_CLIENT" }, { "name" : "MAPREDUCE_CLIENT" }, { "name" : "OOZIE_CLIENT" }, { "name" : "GANGLIA_MONITOR" } ], "cardinality" : "1" } ], "Blueprints" : { "blueprint_name" : "single-node-test", "stack_name" : "HDP", "stack_version" : "1.3.3" } }
-
- For more information on exporting a blueprint see: https://issues.apache.org/jira/browse/AMBARI-4786
- For more information on the blueprint resource see: https://issues.apache.org/jira/browse/AMBARI-4467
- Invoke a POST on the cluster endpoint and specify the blueprint related information. Host information must be provided for each host group being deployed in the cluster. Each host specified will run the components associated with the host group. The host group names specified in the request must match a host group in the specified blueprint.
POST myAmbariServer:8080/api/v1/clusters/c1
{ "blueprint" : "single-node-test", "host_groups" :[ { "name" : "host_group_1", "hosts" : [ { "fqdn" : "myHost.novalocal", "ip" : "172.18.192.3" } ] } ]
This call is asynchronous and returns information that can be used to check the status of the request
202 Accepted { "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/1", "Requests" : { "id" : 1, "status" : "InProgress" } }
Some limitations in this change which will be addressed shortly in other patches:
- configuration information included in the blueprint will not be processed meaning that the cluster will be provisioned with default configurations
- Ambari Agent must be running and have registered with the server on all hosts in the cluster prior to invoking the REST API to provision the cluster
Attachments
Issue Links
- is related to
-
AMBARI-1783 Specification for a cluster blueprint consumable by Ambari
- Resolved
- links to