Call CreateClusterV2 to create a E-MapReduce cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateClusterV2

The operation that you want to perform. Set the value to CreateClusterV2.

BootstrapAction.N.Name String Yes init_script

The name of the bootstrap action.

BootstrapAction.N.Path String Yes oss://bucket/path

The OSS storage path of the boot action script.

ClusterType String Yes HADOOP

The type of the cluster. Valid values:

  • HADOOP
  • KAFKA
  • FLINK
  • GATEWAY
  • DRUID
  • ZOOKEEPER
  • DATA_SCIENCE
  • CLICKHOSUE
  • SHUFFLE_SERVICE
  • EMR_STUDIO
Config.N.ConfigKey String Yes fs.trash.interval

The key of custom configuration item.

Config.N.ConfigValue String Yes 60

The value of custom configuration item.

Config.N.FileName String Yes yarn-site

The name of the file that contains custom configuration item.

Config.N.ServiceName String Yes YARN

The name of the service for which custom configuration item is configured. Specify the entire name in uppercase.

EmrVer String Yes EMR-3.35.0

The EMR version.

Note You can view the EMR version list when you create a cluster in the console.
HostGroup.N.DiskCapacity Integer Yes 80

The data disk capacity of host group.

HostGroup.N.DiskCount Integer Yes 4

The number of data disks in the host group.

HostGroup.N.DiskType String Yes CLOUD_EFFICIENCY

The data disk type of the machine group. Valid values:

  • CLOUD_EFFICIENCY: ultra disk.
  • CLOUD_SSD:SSD.
  • LOCAL_DISK: This value can only be specified for the ECS instance type of the local disk.
  • CLOUD: basic cloud disks (not recommended).
HostGroup.N.HostGroupName String Yes Master Instance Group

The name of the machine group.

HostGroup.N.HostGroupType String Yes MASTER

The type of the machine group. Valid values:

  • MASTER: the primary instance group.
  • CORE: the core instance group.
  • TASK: compute instance group.
Note Only one group can be set for MASTER and CORE.
HostGroup.N.InstanceType String Yes ecs.g6.2xlarge

The type of the ECS instance in the machine group.

HostGroup.N.NodeCount Integer No 2

The number of nodes in host group.

HostGroup.N.SysDiskCapacity Integer Yes 80

The system disk capacity of the machine group. Unit: GB.

HostGroup.N.SysDiskType String Yes CLOUD_SSD

The system disk type of the machine group. Valid values:

  • CLOUD_EFFICIENCY: ultra disk.
  • CLOUD_SSD:SSD.
  • CLOUD: basic cloud disks (not recommended).
Name String Yes bi_hadoop

The name of the cluster. The name must be 1 to 64 characters in length and can contain only letters, digits, hyphens (-), and underscores (_).

RegionId String Yes cn-hangzhou

The region ID of the security group. You can call the DescribeRegions operation to query the most recent region list.

UserInfo.N.Password String Yes pwd

The password of the Knox user.

UserInfo.N.UserId String Yes 123456789

The RAM user ID of the Knox user.

UserInfo.N.UserName String Yes username

The username of the Knox user.

ZoneId String Yes cn-hangzhou-b

The zone ID. You can call the DescribeZones to view zones in an Alibaba Cloud region.

SecurityGroupId String No sg-bp1id7ajv83kmqwq****

The ID of the security group. You can enter the ID of an existing security group. If the security group does not exist, a security group is automatically created.

Note Parameter SecurityGroupId and SecurityGroupName requirements cannot be empty at the same time.
IsOpenPublicIp Boolean No true

Specifies whether to enable public IP addresses for MASTER nodes. Valid values:

  • true: enables public IP addresses. If this feature is enabled, it has a bandwidth of 8 MB by default.
  • false: disables the public IP address.
SecurityGroupName String No emr-sg

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: all ports are opened in the outbound direction.

Note Parameter SecurityGroupId and SecurityGroupName requirements cannot be empty at the same time.
ChargeType String No PostPaid

The billing type of the cluster. Valid values:

  • PostPaid: pay-as-you-go
  • PrePaid: the subscription billing method.
Period Integer No 2

The subscription period. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Unit: months. This parameter is required when the ChargeType parameter is set to PrePaid.

AutoRenew Boolean No false

Indicates whether the subscription cluster is auto-renewal. Valid values:

  • true: enables automatic renewal for the instance.
  • flase: does not auto-renewal.
AutoPayOrder Boolean No true

Specifies whether to pay automatically. This parameter takes effect only when the billing type is PrePay. Valid values:

  • true: automatic payment.
  • false: Do not pay automatically.
VpcId String No vpc-bp1l4urd87xlh7i4b****

The ID of the VPC where the instances reside.

VSwitchId String No vsw-bp10tvjyc77psy0z5****

The ID of the vSwitch to which to connect the instance.

NetType String No VPC

The type of network. Set the value to VPC.

UserDefinedEmrEcsRole String No AliyunEmrEcsDefaultRole

The role authorized to ECS to access OSS and other Alibaba Cloud services:

  • AliyunECSInstanceForEMRRole :3.x series>= EMR-3.33.0, 4.x series>=EMR-4.6.0, 5.x series>=EMR-5.1.0.
  • AliyunEmrEcsDefaultRole:3.x series < EMR-3.33.0, 4.x series <EMR-4.6.0, 5.x series <EMR-5.1.0.
OptionSoftWareList.N RepeatList No ["ZOOKEEPER","LIVY"]

The service name needs to be capitalized. You can view the supported optional services on the Software Configuration page of the cluster created in the EMR console.

HighAvailabilityEnable Boolean No true

Specifies whether to enable a high-availability cluster. Valid values:

  • true: enables a high-availability cluster. A high-availability cluster requires two master nodes.
  • false: disables the high-availability cluster.

The high-availability cluster has at least two MASTER nodes. If the high-availability cluster is not enabled, the high reliability of the cluster cannot be guaranteed.

UseLocalMetaDb Boolean No true

Specifies whether to use the cluster's built-in MySQL as the Hive metadatabase. Valid values:

  • true: uses the local Hive metadatabase.
  • false: The local Hive metadatabase is not available.

The cluster has a built-in MySQL single node and cannot guarantee high reliability.

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).

KeyPairName String No test_pair

Log on to the ECS key pair without password.

MetaStoreType String No local

The type of the Hive metadata service. Valid values:

  • local: The MYSQL service within the cluster. A single node of MYSQL does not guarantee high availability.
  • user_rds: user-created RDS service.
  • dlf:DLF metadata service.
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. Valid values:

  • If MetaStoreType:local or dlf, this parameter is not specified.
  • MetaStoreType:user_rds. Example:

    {"dbUrl":"jdbc:mysql://rm-*.mysql.rds.aliyuncs.com/hmsdata?createDatabaseIfNotExist=true&characterEncoding=UTF-8","dbUserName":"name *","dbPassword":"pws "}.

ClickHouseConf String No No default value

A reserved parameter. You do not need to specify this parameter.

ExtraAttributes String No No default value

A reserved parameter. You do not need to specify this parameter.

HostComponentInfo.N.HostName String No emr-header-1

The target host name of the component deployment.

HostComponentInfo.N.ServiceName String No HDFS

The name of the service to which the component belongs. The service name is in uppercase letters, such as HDFS and ZOOKEEPER. Optional services can be obtained from the EMR console to create a cluster Step 1-Software Configuration-Service List View.

HostComponentInfo.N.ComponentNameList.N RepeatList No NAMENODE

The list of the components.

ServiceInfo.N.ServiceName String No HDFS

The name of the service. The service name is in uppercase letters, such as HDFS and ZOOKEEPER. Optional services can be obtained from the EMR console to create a cluster Step 1-Software Configuration-Service List View.

ServiceInfo.N.ServiceVersion String No 2.3.3-1.0.2

The internal version of the service.

PromotionInfo.N.PromotionOptionNo String No 11080***0000

The coupon number.

PromotionInfo.N.PromotionOptionCode String No youhui_quan

The type of the coupon. This parameter is optional. Default value: youhui_quan.

PromotionInfo.N.ProductCode String No ecs

The product of the coupon application. Valid values:

  • emr : applies to EMR orders.
  • ecs : applies to ECS orders.
DepositType String No HALF_MANAGED

The managed type of the cluster. Set the value to HALF_MANAGED.

Semi-managed indicates that the EMR cluster uses user-side ECS or ACK.

MachineType String No ECS

The resource type of the IaaS layer that is built on the cluster.

HostGroup.N.ClusterId String No No default value

A reserved parameter. You do not need to specify this parameter.

HostGroup.N.HostGroupId String No No default value

A reserved parameter. You do not need to specify this parameter.

HostGroup.N.Comment String No No default value

A reserved parameter. You do not need to specify this parameter.

HostGroup.N.CreateType String No No default value

The type of the machine group creation. Valid values:

  • ON-DEMAND: created as needed.
  • MANUAL: manually created.
HostGroup.N.ChargeType String No PostPaid

The type of the payment. Valid values:

  • PostPaid: pay-as-you-go.
  • PrePaid: subscription.
HostGroup.N.Period Integer No 2

The length of the subscription. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Unit: months. Set this parameter when HostGroup.n.ChargeType is set to PrePaid.

HostGroup.N.AutoRenew Boolean No false

machine group whether the machine is auto-renewal. Valid values:

  • true: enables automatic renewal for the instance.
  • false: manual renewal.
HostGroup.N.VSwitchId String No vsw-bp10tvjyc77psy0z5****

The ID of the VSwitch.

HostGroup.N.GpuDriver String No cuda9

The name of the GPU driver.

HostGroup.N.PrivatePoolOptionsMatchCriteria String No Target

The type of the private pool. A private pool is generated after an elasticity assurance or a capacity reservation takes effect. You can select the private pool when you create instances. Valid values:

  • Open: open private pool. The system selects a matching open private pool to create the instance. If no matching open private pools are found, resources in the public pool are used. In this mode, you do not need to set the HostGroup.N.PrivatePoolOptionsId parameter.
  • Target: specified private pool. The capacity in a specified private pool is used. If the specified private pool is unavailable, the instance cannot be created. In this mode, you must specify the private pool ID, that is, the HostGroup.N.PrivatePoolOptionsId parameter is required.
  • None: no private pool. The capacity in private pools is not used.
HostGroup.N.PrivatePoolOptionsId String No crp-bp1e4wcvoucrish*****

The ID of the private pool. 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.Arg String No --arg1=value1

The argument that you pass into bootstrap action.

BootstrapAction.N.ExecutionTarget String No core_group

The scope of script execution. Valid values:

  • For the entire cluster, specify a null value.
  • The name of the machine group.
BootstrapAction.N.ExecutionMoment String No BEFORE_INSTALL

The execution timing of the script. Valid values:

  • BEFORE_INSTALL: This parameter is executed before the cluster service is installed.
  • AFTER_STARTED: is executed after the cluster service is started.
BootstrapAction.N.ExecutionFailStrategy String No FAILED_BLOCKED

The script failure execution policy. Valid values:

  • FAILED_BLOCKED: The workflow is manually processed after a failure.
  • FAILED_CONTINUE: continues after failure.
UseCustomHiveMetaDB Boolean No false

A reserved parameter. You do not need to specify this parameter.

InitCustomHiveMetaDB Boolean No false

A reserved parameter. You do not need to specify this parameter.

Config.N.Encrypt String No 0

A reserved parameter. You do not need to specify this parameter.

Config.N.Replace String No 0

A reserved parameter. You do not need to specify this parameter.

Configurations String No 0

A reserved parameter. You do not need to specify this parameter.

EasEnable Boolean No false

Specifies whether to enable high security for the cluster. Valid values:

  • true: high-security clusters.
  • false: The cluster is not a high-security cluster.
RelatedClusterId String No C-D7958B72E59B****

The ID of the primary cluster associated with the current cluster if it is a gateway.

WhiteListType String No IP

The type of the whitelist. Valid values:

  • IP:IP address whitelist group.
  • SecurityGroup: the security group.
AuthorizeContent String No No default value

A reserved parameter. You do not need to specify this parameter.

Tag.N.Key String No Dept

The tag key of the EMR instance and node ECS instance. Valid values of N: 1 to 20 The tag value cannot be an empty string. The value of the tag key ranges from 1 to 128. It cannot start with acs: or aliyun. It cannot contain http:// or https://.

Tag.N.Value String No DevIT

The tag values of EMR instances and node ECS instances. Valid values of N: 1 to 20. The tag value can be an empty string. Valid values: 1 to 128. It cannot start with acs: and cannot contain http:// or https://.

ResourceGroupId String No rg-bp67acfmxazb4p****

The ID of the enterprise resource group to which the EMR cluster 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 the value, but you must make sure that it is unique among different requests.

Response parameters

Parameter Type Example Description
ClusterId String C-D7958B72E59B****

The ID of the cluster.

CoreOrderId String None.

The order ID of the core node.

EmrOrderId String None.

The ID of the E-MapReduce order.

MasterOrderId String None.

The order ID of the master node.

RequestId String BF4FBAC6-B03E-4BFB-B6DB-EB53C34F2E22

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateClusterV2
&BootstrapAction.1.Name=name
&BootstrapAction.1.Path=oss://bucket/path
&ClusterType=HADOOP
&Config.1.ConfigKey=fs.trash.interval
&Config.1.ConfigValue=60
&Config.1.FileName=yarn-site
&Config.1.ServiceName=YARN
&EmrVer=EMR-3.15.0
&HostGroup.1.HostGroupType=MASTER
&HostGroup.1.InstanceType=ecs.mn4.2xlarge
&HostGroup.1.NodeCount=2
&Name=bi_hadoop
&RegionId=cn-hangzhou
&UserInfo.1.Password=pwd
&UserInfo.1.UserId=12345
&UserInfo.1.UserName=tom
&<Common request parameters>

Sample success responses

XML format

<ClusterId>C-4DE6DA872B0E****</ClusterId>
<RequestId>F4DE89FB-7054-475C-B7E2-B9A38152DA7E</RequestId>

JSON format

{
    "ClusterId": "C-4DE6DA872B0E****",
    "RequestId": "F4DE89FB-7054-475C-B7E2-B9A38152DA7E"
}