Working with Host Templates
Host Templates let you designate a set of role groups that can be applied in a single operation to a host or a set of hosts. This significantly simplifies the process of configuring new hosts when you need to expand your cluster. Host templates are supported for both CDH4 and CDH3 cluster hosts.
A host template can only be applied on a host with a version of CDH that matches the CDH version running on the cluster to which the host template belongs.
You can create and manage host templates under the Templates tab from the All Hosts page.
- Click the Hosts tab on the main Cloudera Manager navigation bar.
- Click the Templates tab on the All Hosts page.
Templates are not required; Cloudera Manager assigns roles and role groups to the hosts of your cluster when you perform the initial cluster installation. However, if you want to add new hosts to your cluster, a host templates can make this much easier.
If there are existing host templates, they are listed on the page, along with links to each role group included in the template.
- You can click a role group name to be taken to the Edit page for that role group, where you can modify the role group settings.
- From the Actions menu associated with the template you can edit the template, or delete it.
Creating a Host Template
- From the Templates tab, click Create...
- In the Create New Host Template pop-up window that appears:
- Type a name for the template.
- For each role, select either the "none" option, or the appropriate role group. There may be multiple role groups for a given role type — you want to select the one with the configuration that meets your needs. Selecting the "none" option means no role group will be included in the template for that role type.
- Click Create to create the Host Template.
Editing a Host Template
- From the Hosts tab, click the Templates tab.
- Pull down the Actions menu for the template you want to modify, and click Edit. This put you into the Edit Host Template pop-up window. This works exactly like the Create New Host Template window — you can modify they template name or any of the role group selections.
- Click OK when you have finished.
Applying a Host Template to a Host
You can use a host template to apply configurations for multiple roles in a single operation.
You can apply a template to a host that has no roles on it, or that has roles from the same services as those included in the host template. New roles specified in the template that do not already exist on the host will be added. A role on the host that is already a member of the role group specified in the template will be left unchanged. If a role on the host matches a role in the template, but is a member of a different role group, it will be moved to the role group specified by the template.
For example, suppose you have two role groups for a DataNode (DataNode (Base) and DataNode (1)). The host has a DataNode role that belongs to the DataNode (Base) group. If you apply a host template that specifies the DataNode (1) group, the role on the host will be moved from DataNode (Base) to DataNode (1).
However, if you have two instances of a service, such as MapReduce ( for example, mr1 and mr2) and the host has a TaskTracker role from service mr2, you cannot apply a TaskTracker role from service mr1.
Note that a host may have no roles on it if you have just added the host to your cluster, or if you decommissioned a managed host and removed its existing roles.
Also note that the host must have the same version of CDH installed as is running on the cluster whose host templates you are applying.
The following instructions assume you have already created the appropriate host template.
- Go to the All Hosts page, Status tab.
- Select the host(s) to which you want to apply your host template.
- From the Actions for Selected menu, select Apply Host Template.
- In the pop-up window that appears, select the host template you want to apply.
- Optionally you can have Cloudera Manager start the roles created per the host template – check the box to enable this.
- Click Confirm to initiate the action.