Call the CreateClusterTemplate operation to create a E-MapReduce cluster template.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateClusterTemplate | The operation that you want to perform. Set the value to CreateClusterTemplate. |
ClusterType | String | Yes | HADOOP | The type of the cluster. Valid values:
|
TemplateName | String | Yes | ETLClusterTemplate | The name of the template. |
ZoneId | String | Yes | cn-hangzhou-b | The zone ID of the cluster. You can call the DescribeZones operation to query the most recent zone list. |
BootstrapAction.N.Name | String | Yes | init_script | The name of the bootstrap action. |
BootstrapAction.N.Path | String | Yes | oss://bucket/path | The OSS path in which you want to store the bootstrap action script. |
Config.N.ConfigKey | String | Yes | fs.trash.interval | The key of custom configuration item N. |
Config.N.ConfigValue | String | Yes | 60 | The value of custom configuration item N. |
Config.N.FileName | String | Yes | yarn-site | The name of the file that contains custom configuration item N. |
Config.N.ServiceName | String | Yes | YARN | The name of the service for which custom configuration item N is configured. Specify the entire name in uppercase. |
HostGroup.N.DiskCapacity | Integer | Yes | 80 | The data disk capacity of host group N. |
HostGroup.N.DiskCount | Integer | Yes | 1 | The number of data disks in host group N. |
HostGroup.N.DiskType | String | Yes | CLOUD_EFFICIENCY | The type of the machine group data disk. Valid values:
|
HostGroup.N.HostGroupName | String | Yes | master_group | The name of the machine group. |
HostGroup.N.HostGroupType | String | Yes | MASTER | The type of the machine group. Valid values:
Note Both MASTER and CORE support setting up only one group. |
HostGroup.N.InstanceType | String | Yes | ecs.g5.xlarge | The ECS instance type in the machine group. For more information, see Overview of instance families or call the DescribeInstanceTypes operation to query the most recent instance type list. |
HostGroup.N.NodeCount | Integer | Yes | 2 | The number of nodes in host group N. |
HostGroup.N.SysDiskCapacity | Integer | Yes | 80 | The system disk capacity of host group N. |
HostGroup.N.SysDiskType | String | Yes | CLOUD_SSD | The type of the system disk. Valid values:
|
EmrVer | String | Yes | EMR-3.35.0 | The version of EMR. Tips: You can view the EMR version list when you create a cluster in the console. |
RegionId | String | Yes | cn-hangzhou | The region ID of the command. You can call the DescribeRegions operation to query the most recent region list. |
KeyPairName | String | No | test_pair | Password-free logon to the ECS key pair. |
MetaStoreType | String | No | user_rds | The type of the Hive metadata service. Valid values:
|
MetaStoreConf | String | No | {"dbUrl":"jdbc:mysql://rm-xxxxxxxxxx.mysql.rds.aliyuncs.com/hmsdata?createDatabaseIfNotExist=true&characterEncoding=UTF-8","dbUserName":"xxxxxxx","dbPassword":"xxxxxx"} | The configuration information of the unified metadata service. If MetaStoreType is set to local or dlf, this parameter is not specified. If you set the MetaStoreType parameter to user_rds, you can set the value to {"dbUrl":"jdbc:mysql://rm-xxxxxxxxxx.mysql.rds.aliyuncs.com/hmsdata?createDatabaseIfNotExist=true&characterEncoding=UTF-8","dbUserName":"xxxxxxx","dbPassword":"xxxxxx"}. |
HostGroup.N.PrivatePoolOptionsMatchCriteria | String | No | Target | The type of the private pool to use to create the instance. A private pool is generated when an elasticity assurance or a capacity reservation takes effect. You can select a private pool when you create an instance. Valid values:
|
HostGroup.N.PrivatePoolOptionsId | String | No | crp-bp1e4wcvoucrish**** | The ID of the private pool to use to create the instance. The ID of a private pool is the same as that of the elasticity assurance or capacity reservation for which the private pool is generated. |
BootstrapAction.N.ExecutionTarget | String | No | core_group | The scope of the script. Valid values:
|
BootstrapAction.N.ExecutionMoment | String | No | BEFORE_INSTALL | The timing of the script. Valid values:
|
BootstrapAction.N.ExecutionFailStrategy | String | No | FAILED_BLOCKED | The execution policy for script failures. Valid values:
|
Tag.N.Key | String | No | Dept | The key of the EMR cluster tag. You can specify 1 to 20 tag keys. The tag value cannot be an empty string. The value of a tag key ranges from 1 to 128. It cannot start with aliyun or acs:, and cannot contain http:// or https://. |
Tag.N.Value | String | No | DevIT | The tag value of the EMR cluster. You can specify 1 to 20 tag values. It can be an empty string. Valid values of tag values: 1 to 128. The tag value cannot start with acs: and cannot contain http:// or https://. |
ResourceGroupId | String | No | rg-bp67acfmxazb4p**** | The ID of the resource group to which the EIP belongs. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-42665544**** | The client token that is used to ensure the idempotence of the request. You can use the client to generate a client token. Make sure that a unique client token is used for each request. |
DataDiskEncrypted | Boolean | No | false | A reserved parameter. |
DataDiskKMSKeyId | String | No | false | A reserved parameter. |
Configurations | String | No | [{"classification": "core-site","properties": {"fs.trash.interval": "61"}},{"classification": "hadoop-log4j","properties": {"hadoop.log.file": "hadoop1.log","hadoop.root.logger": "INFO","a.b.c": "ABC"}}] | The custom configuration items for software. You can use a JSON file to modify the software configurations before you start a cluster. |
EasEnable | Boolean | No | true | Specifies whether to enable high security for the cluster. Valid values:
|
HighAvailabilityEnable | Boolean | No | true | Specifies whether to enable the high-availability cluster. Valid values:
A high-availability cluster has at least two master nodes. If the high-availability cluster is not enabled, high reliability cannot be guaranteed. |
InitCustomHiveMetaDb | Boolean | No | false | A reserved parameter. |
InstanceGeneration | String | No | ecs-3 | The generation of ECS instances. |
IoOptimized | Boolean | No | true | Specifies whether to enable I/O optimization. Default value: true. This parameter is obsolete. Valid values:
|
IsOpenPublicIp | Boolean | No | true | Specifies whether to enable public IP addresses. Valid values:
|
LogPath | String | No | oss://bucket/path | The OSS log path. This parameter is obsolete. |
MachineType | String | No | ECS | The type of the IaaS-layer resource that is used to build the cluster. Set the value to ECS. |
MasterPwd | String | No | pwd | The root password of the master node. The password must be 8 to 30 characters in length and contain any three characters (uppercase letters, lowercase letters, digits, and special character). |
NetType | String | No | VPC | Indicates the network type of the ApsaraDB RDS for MySQL instance. Set the value to VPC. |
OptionSoftWareList.N | RepeatList | No | ["HBASE","FLINK"] | The list of optional services. The service name is in uppercase letters, such as ZOOKEEPER,LIVY. You can view the optional services from Step 1-Software Configuration-Optional Services in the EMR console to create a cluster. |
Period | Integer | No | 36 | The expiration time of the subscription cluster. Unit: months. |
SecurityGroupId | String | No | sg-bp1id7ajv83kmqwq**** | The ID of the security group. |
SecurityGroupName | String | No | sg-name | The name of the security group to be created. If you do not specify SecurityGroupId, a security group is created with the value of this parameter as its name. After the cluster is created, you can view the ID of the security group in cluster details. This security group will have the default security group policy: open all ports in the outbound direction. Parameter SecurityGroupId and SecurityGroupName requirement cannot both be empty. |
SshEnable | Boolean | No | true | Specifies whether to modify the security group rule to allow SSH logon from the Internet. Default value: false. This parameter is deprecated. Valid values:
|
UseCustomHiveMetaDb | Boolean | No | false | A reserved parameter. You do not need to specify this parameter. |
UseLocalMetaDb | Boolean | No | false | Specifies whether to use the built-in MySQL database of the cluster as the Hive metadatabase. Valid values:
A single MySQL node is built in a cluster and cannot guarantee high reliability. |
UserDefinedEmrEcsRole | String | No | AliyunEmrEcsDefaultRole | The ECS application role that allows internal access from ECS to other Alibaba Cloud services, such as Object Storage Service (OSS).
|
VpcId | String | No | vpc-bp1l4urd87xlh7i4b**** | The ID of the virtual private cloud (VPC) to which the instances belong. |
VSwitchId | String | No | vsw-bp10tvjyc77psy0z5**** | The ID of the vSwitch to which you want to connect the instance. |
BootstrapAction.N.Arg | String | No | --arg1 | The argument that you pass into bootstrap action N. |
Config.N.Encrypt | String | No | 0 | A reserved parameter. |
Config.N.Replace | String | No | 0 | A reserved parameter. |
HostGroup.N.AutoRenew | Boolean | No | false | machine group whether the machine is auto-renewal. Valid values:
|
HostGroup.N.ChargeType | String | No | PostPaid | The billing method of the instance. Valid values:
|
HostGroup.N.ClusterId | String | No | 0 | A reserved parameter. |
HostGroup.N.Comment | String | No | header | The comment for host group N. |
HostGroup.N.CreateType | String | No | ON-DEMAND | The type of the machine group. Valid values:
|
HostGroup.N.HostGroupId | String | No | 0 | A reserved parameter. |
HostGroup.N.MultiInstanceTypes | String | No | ["ecs.c5.xlarge","ecs.sn1ne.xlarge","ecs.hfc5.xlarge"] | A JSON field that consists of the supported instance types. |
HostGroup.N.Period | Integer | No | 30 | The validity period of host group N. |
HostGroup.N.VSwitchId | String | No | vsw-bp10tvjyc77psy0z5**** | The ID of the VSwitch. |
AutoRenew | Boolean | No | false | Specifies whether to automatically renew the subscription. |
DepositType | String | No | HALF_MANAGED | The hosting type of the cluster. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ClusterTemplateId | String | CT-35498C56B3F1**** | The ID of the cluster template. |
RequestId | String | 8CA40D40-2092-4A09-9F07-2F9C1399FB11 | The request ID. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateClusterTemplate
&ClusterType=HADOOP
&TemplateName=templateName2
&BootstrapAction.1.1ame=action_name
&BootstrapAction.1.Path=oss://bucket/path
&Config.1.ConfigKey=fs.trash.interval
&Config.1.ConfigValue=60
&Config.1.FileName=yarn-site
&Config.1.ServiceName=YARN
&HostGroup.1.HostGroupType=MASTER
&HostGroup.1.InstanceType=ecs.g5.xlarge
&HostGroup.1.1odeCount=2
&EmrVer=EMR-3.15.0
&RegionId=cn-hangzhou
&<Common request parameters>
Sample success responses
XML
format
<RequestId>8CA40D40-2092-4A09-9F07-2F9C1399FB11</RequestId>
<ClusterTemplateId>CT-35498C56B3F1****</ClusterTemplateId>
JSON
format
{
"RequestId": "8CA40D40-2092-4A09-9F07-2F9C1399FB11",
"ClusterTemplateId": "CT-35498C56B3F1****"
}