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 name

The name of bootstrap action N.

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

The path where the script of bootstrap action N is stored.

ClusterType String Yes HADOOP

Cluster type, with the following values:

  • HADOOP
  • KAFKA
  • FLINK
  • GATEWAY
  • DRUID
  • DATA_SCIENCE
  • CLICKHOSUE
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.

EmrVer String Yes EMR-3.15.0

The EMR version.

HostGroup.N.DiskCapacity Integer Yes 80

The data disk capacity of host group N.

HostGroup.N.DiskCount Integer Yes 4

The number of data disks in the host group.

HostGroup.N.DiskType String Yes CLOUD_SSD

The system disk type of the machine group, with the following values:

  • CLOUD: common cloud disk
  • CLOUD_EFFICIENCY: Efficient Cloud Disk
  • CLOUD_SSD:SSD cloud disk
HostGroup.N.HostGroupName String Yes Master Instance Group

The name of host group N.

HostGroup.N.HostGroupType String Yes MASTER

The type of machine group to be queried, with the following values:

  • MASTER: primary instance group
  • CORE: core instance group
  • TASK: compute instance group
Note Currently MASTER and CORE Only one group is supported.
HostGroup.N.InstanceType String Yes ecs.mn4.2xlarge

The type of instances in host group N.

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 system disk type of the machine group, with the following values:

  • CLOUD: common cloud disk
  • CLOUD_EFFICIENCY: Efficient Cloud Disk
  • CLOUD_SSD:SSD cloud disk
Name String Yes bi_hadoop

The name of the cluster. The length is limited to 1 to 64 characters, and only Chinese, letters, digits,-,_are allowed.

RegionId String Yes cn-hangzhou

The region ID. You can call DescribeRegions View the latest list of Alibaba Cloud regions.

UserInfo.N.Password String Yes pwd

The password of the Knox user.

UserInfo.N.UserId String Yes 123456789

The user RAM 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 DescribeZones View the available areas under the Alibaba Cloud region.

LogPath String No oss//bucketname/path

The path of logs that are stored in OSS buckets.

SecurityGroupId String No sg-bp1id7ajv83kmqwq****

The ID of the security group. You can create a security group in the ECS instance and use the ID of this security group. Note that if you are using an existing security group, the default security group policy applies to this security group. The default policy allows inbound traffic only on port 22 and outbound traffic on all ports.

IsOpenPublicIp Boolean No true

Whether to enable public IP, the value is as follows:

  • true: Turn on the public IP address. If it is turned on, it will have a bandwidth of 8 MB by default.
  • false: The public IP address is not enabled.
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. The default security group policy is applied to this security group. The default policy only allows inbound traffic through port 22 but allows outbound traffic through all ports.

ChargeType String No PostPaid

The billing method. Valid values:

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

The subscription period. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Unit: months. Required when ChargeType=PrePaid.

AutoRenew Boolean No false

Whether the package year and month cluster is auto-renewal, the value is as follows:

  • true: Enables auto-renewal.
  • flase: not auto-renewal
AutoPayOrder Boolean No true

Whether to pay automatically, the value is as follows:

  • true: auto-pay
  • false: does not pay automatically
VpcId String No vpc-bp1l4urd87xlh7i4b****

The ID of the VPC.

VSwitchId String No vsw-bp10tvjyc77psy0z5****

The ID of the vSwitch to which the instance is connected.

NetType String No VPC

The type of network.

UserDefinedEmrEcsRole String No AliyunEmrEcsDefaultRole

The role that is assigned to EMR to call ECS resources.

OptionSoftWareList.N RepeatList No ["ZOOKEEPER","LIVY"]

The list of optional services.

HighAvailabilityEnable Boolean No true

Whether to enable a highly available cluster, the value is as follows:

  • true: Turn on a highly available cluster. A high-availability cluster requires two master nodes.
  • false: High-availability clusters are not enabled.
UseLocalMetaDb Boolean No true

Whether to use the local Hive metadatabase, the value is as follows:

  • true: uses the local Hive metadatabase.
  • false: Not local Hive metadatabase.
IoOptimized Boolean No true

Whether to turn on I/O optimization, the value is as follows:

  • true: turn on I/O optimization
  • false: do not turn on I/O optimization
SshEnable Boolean No true

Whether to enable SSH, the value is as follows:

  • true: Enable SSH
  • false: does not enable SSH
InstanceGeneration String No ecs-3

The instance type.

MasterPwd String No pwd

The SSH password that is used to access the master node. The password rules of ECS must be met: 8 to 30 characters in length and contain any three items (uppercase, lowercase letters, digits, and special character).

KeyPairName String No test_pair

The key pair.

MetaStoreType String No local

Unified metadata type, with the following values:

  • local: cluster internal metadata
  • unified: unified metadata
  • user_rds: user-built RDS
MetaStoreConf String No rds-xxx.com

The configuration information of Hive Metastore.

ClickHouseConf String No N/A

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

ExtraAttributes String No N/A

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

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

The name of a host.

HostComponentInfo.N.ServiceName String No HDFS

The name of a service.

HostComponentInfo.N.ComponentNameList.N RepeatList No NAMENODE

The list of the components.

ServiceInfo.N.ServiceName String No HDFS

The name of the service.

ServiceInfo.N.ServiceVersion String No 2.3.3-1.0.2

The internal version of the service.

PromotionInfo.N.PromotionOptionNo String No N/A

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

PromotionInfo.N.PromotionOptionCode String No N/A

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

PromotionInfo.N.ProductCode String No N/A

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

DepositType String No HALF_MANAGED

The hosting type of the cluster. The value is as follows:

  • HALF_MANAGED: semi-managed
  • MANAGED: fully managed
MachineType String No ECS

The instance type.

HostGroup.N.ClusterId String No N/A

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

HostGroup.N.HostGroupId String No N/A

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

HostGroup.N.Comment String No N/A

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

HostGroup.N.CreateType String No N/A

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

HostGroup.N.ChargeType String No PostPaid

The billing method of the host. 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, the value is as follows:

  • true: Enables auto-renewal.
  • 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.

BootstrapAction.N.Arg String No --a=b

The argument that you pass into bootstrap action N.

BootstrapAction.N.ExecutionTarget String No core_group

The script execution scope. Valid values:

  • For the entire cluster, just pass in a null value.
  • Set the name of the machine group
BootstrapAction.N.ExecutionMoment String No BEFORE_INSTALL

When the script is executed, the value is as follows:

  • BEFORE_INSTALL: executed before service installation
  • AFTER_STARTED: Executed after service startup
BootstrapAction.N.ExecutionFailStrategy String No FAILED_BLOCKED

The script fails to execute the policy. The value is as follows:

  • FAILED_BLOCKED: Workflow to manual processing after failure
  • FAILED_CONTINUE: Continue execution 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

Whether it is a high-security cluster. The value is as follows:

  • true: High-security clusters
  • false: non-high-security cluster
RelatedClusterId String No C-D7958B72E59B****

When the current cluster is Gateway, its associated primary cluster ID.

WhiteListType String No IP

The whitelist type, with the following values:

  • IP : IP whitelist grouping
  • SecurityGroup : security group
AuthorizeContent String No N/A

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

Tag.N.Key String No TestKey

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

Tag.N.Value String No TestValue

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. The value range of the tag value: 1~128, which cannot start with acs: and cannot contain http:// or https://.

ResourceGroupId String No rg-bp67acfmxazb4p****

The ID of the enterprise resource group where the EMR instance and the node ECS instance are located.

Response parameters

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

The ID of the cluster.

CoreOrderId String N/A

The order ID of the core node.

EmrOrderId String N/A

E-MapReduce order ID.

MasterOrderId String N/A

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 responses

XML format

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

JSON Syntax

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