Versions Compared

Key

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

...

Code Block
{
  "blueprint" : "blueprint-name",
  "default_password" : "super-secret-password",
  "configurations" : [
    {
      "configuration-type" : {
        "property-name" : "property-value"
      }
    }
    ...
  ],     
  "host_groups" :[
    { 
      "name" : "host-group-name",  
      "configurations" : [
        {
          "configuration-type" : {
            "property-name" : "property-value"
          }
        }
      ],     
      "hosts" : [          
        { 
          "fqdn" : "host.domain.com"
        },
        { 
          "fqdn" : "host2.domain.com"
        }
        ...
      ]
    }
    ...
  ]
}
 Cluster Creation Template Structure: Host Mappings and Configuration Field Descriptions
Info

Starting in Ambari version 2.1.0, it is possible to specify a host count and a host predicate in the cluster creation template host group section instead of a host name.

Code Block
{
  "name" : "group-using-host-count",
  "host_count" : 5,
  "host_predicate" : "Hosts/os_type=centos6&Hosts/cpu_count=2"
} 

Cluster Creation Template Structure: Host Mappings and Configuration Field Descriptions

  • blueprint : Name of the blueprint that defines the cluster to be deployed.  Blueprint must already exist.  Required field.
  • default_password : Optional field which specifies a default password for all required passwords which are not specified in the blueprint or cluster creation template configurations.
  • configurations : A list of configuration maps keyed by configuration type. An example of a configuration type is "core-site".  When specified at the top level, configurations are applied at cluster scope and override default values for the cluster.  When specified within a "host_groups" element, configurations are applied at the host level for all hosts mapped to the host group.  Host scoped configurations override cluster scoped configuration for all hosts mapped to the host group.  All cluster scoped and host group scoped configurations specified here override configurations specified in the corresponding blueprint.  The configurations element is optional at both levels.  
  • host_groups : A list of host groups being deployed to the cluster.  At least one host group must be specified.
    • name : Required field which must correspond to a name of a host group in the associated blueprint.
    • hosts : List of host mapping information
      • fqdn : Fully qualified domain name for each host that is being mapped to the host group.  At least one host must be specified
    • host_count : The number of hosts that should be mapped to this host group. This can be specified instead of concrete host names.  If no host_predicate is specified, any host that isn't explicitly mapped to another host group is available to be mapped to this host group.  Available as of Ambari 2.1.0. 
    • host_predicate : Optional field which is used together with host_count to control which hosts are mapped to the host group.  This is useful in supporting host 'flavors' where different host groups require different host types.  The default predicate matches all hosts which aren't explicitly mapped to another host group.  The syntax of the predicate is the standard Ambari API query syntax applied against the "api/v1/hosts" endpoint.  Available as of Ambari 2.1.0.
  • blueprint : Name of the blueprint that defines the cluster to be deployed.  Blueprint must already exist.  Required field.
  • default_password : Optional field which specifies a default password for all required passwords which are not specified in the blueprint or cluster creation template configurations.
  • configurations : A list of configuration maps keyed by configuration type. An example of a configuration type is "core-site".  When specified at the top level, configurations are applied at cluster scope and override default values for the cluster.  When specified within a "host_groups" element, configurations are applied at the host level for all hosts mapped to the host group.  Host scoped configurations override cluster scoped configuration for all hosts mapped to the host group.  All cluster scoped and host group scoped configurations specified here override configurations specified in the corresponding blueprint.  The configurations element is optional at both levels.  
  • host_groups : A list of host groups being deployed to the cluster.  At least one host group must be specified.
    • name : Required field which must correspond to a name of a host group in the associated blueprint.
    • hosts : List of host mapping informationfqdn : Fully qualified domain name for each host that is being mapped to the host group.  At least one host must be specified
Configurations
Default Values and Overrides

...

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.

Explicit Host Name Example

Code Block
{
  "blueprint" : "single-node-hdfs-yarn",
  "default_password" : "my-super-secret-password",
  "host_groups" :[
    { 
      "name" : "host_group_1",  
      "hosts" : [          
        { 
          "fqdn" : "c6401.ambari.apache.org"
        }
      ]
    }
  ]
}

Create Cluster Instance

Post the cluster to the Ambari Server to provision the cluster.

...

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-node example cluster creation template 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
{
  "blueprint" : "multi-node-hdfs-yarn",
  "default_password" : "my-super-secret-password",
  "host_groups" :[
Code Block
{
  "blueprint" : "multi-node-hdfs-yarn",
  "default_password" : "my-super-secret-password",
  "host_groups" :[
    { 
      "name" : "master",  
      "hosts" : [          
        { 
          "fqdn" : "c6401.ambari.apache.org" 
        }
      ]
    },
    { 
      "name" : "slavesmaster",  
      "hosts" : [          
        { 
          "fqdn" : "c6402c6401.ambari.apache.org" 
        },
      ]
  {  },
    { 
      "fqdnname" : "c6403.ambari.apache.org"slaves",  
      "host_count" : }5,
      ] "host_predicate" : "Hosts/os_type=centos6&Hosts/cpu_count=2"
    }
  ]
}
Create Cluster Instance

Post the cluster to the Ambari Server to provision the cluster.

...