How-to: Easily Configure and Manage Clusters in Cloudera Manager 4.5
- by Omar Alrubaiyan
- June 03, 2013
- no comments
Helping users manage hundreds of configurations for the growing family of Apache Hadoop services has always been one of Cloudera Manager’s main goals. Prior to version 4.5, it was possible to set configurations at the service (e.g. hdfs), role type (e.g. all datanodes), or individual role level (e.g. the datanode on machine17). An individual role would inherit the configurations set at the service and role-type levels. Configurations made at the role level would override those from the role-type level. While this approach offers flexibility when configuring clusters, it was tedious to configure subsets of roles in the same way.
In Cloudera Manager 4.5, this issue is addressed with the introduction of role groups. For each role type, you can create role groups and assign configurations to them. The members of those groups then inherit those configurations. For example, in a cluster with heterogeneous hardware, a datanode role group can be created for each host type and the datanodes running on those hosts can be assigned to their corresponding role group. That makes it possible to tweak the configurations for all the datanodes running on the same hardware by modifying the configurations of one role group.
In addition to making it easy to manage configurations of subsets of roles, role groups also make it possible to maintain different configurations for experimentation or managing shared clusters for different users and/or workloads.
Viewing and Editing Role Group Configurations
When your services are initially created in Cloudera Manager, role groups are automatically created for each role type based on variables such as the distribution of roles on hosts and hardware diversity in the cluster. Existing groups can be seen by going to a service page and clicking View & Edit under the Configuration tab.
All the role groups under a service are listed on the left panel. Clicking on the group name or a configuration function under it will display the configurations for that group. When using the search box on the top left you can quickly find a particular configuration and compare or modify its value across different role groups on the same page. The category in the filtered configurations will be prefixed with the role group name.
Managing Role Groups
You can manage role groups by clicking Role Groups under the Configuration tab. This page lists all the role groups, organized by role type, under the service. Clicking on a role group will show all the roles that are currently assigned to it. Roles can be moved in batches by selecting them, clicking Move To Different Role Group…from the actions drop down menu and then specifying an existing group as the destination.
Role groups can be created here by clicking the Create new group… button at the bottom left of the page and then specifying the group’s name and type. Optionally, an existing group can be selected so that its configurations will be copied to the new group, effectively cloning it. Cloning an existing group, especially one that was automatically created by Cloudera Manager, is generally the recommended way to create new groups as that will build on the automatic configuration that Cloudera Manager performed when the service was first created.
In typical environments, sets of hosts have the same hardware and the same set of services running on them. That’s where host templates come into play. Host templates define a set of role groups (at most one of each type) in a cluster and provide two main functionalities:
- Adding new hosts to clusters easily — multiple hosts can have roles from different services created, configured, and started in a single operation.
- Altering the configuration of roles from different services on a set of hosts easily — which is useful for quickly switching the configuration of an entire cluster to accommodate different workloads or users.
Create host templates by going to the Hosts page, clicking the Templates tab, and then clicking the Create button.
Once a host template is created with the desired role groups, you can apply it to role groups by navigating to the Status tab. From there, multiple hosts can be selected and the Apply Host Template action used to either populate them with missing roles or alter the configuration of existing roles. Existing roles will never be deleted even if there’s no role group with a matching role type in the host template.
You can also apply host templates via the Add New Hosts to Cluster wizard, which is used when expanding a cluster with new hosts.
As we’ve seen, the combination of role groups and host templates makes managing complex cluster configurations a breeze. The usefulness of these features extends to the Cloudera Manager API making scripts for managing configurations much simpler. A follow-up post will explain how to transition from the V2 API, where configurations were set at the role-type level, to the V3 API, where configurations are set the role-group level.
Omar Alrubaiyan is a Software Engineer on the Enterprise team.