You can call the CreateClusterV2 operation 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. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

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

The cluster type. Values are as follows:

  • HADOOP
  • KAFKA
  • GATEWAY
  • DRUID
  • ZOOKEEPER
  • DATA_SCIENCE
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

Machine Group system disk type:

  • CLOUD: basic CLOUD disk
  • CLOUD_EFFICIENCY: Ultra disk
  • CLOUD_SSD: Cloud SSD
HostGroup.N.HostGroupName String Yes Master Instance Group

The name of host group N.

HostGroup.N.HostGroupType String Yes MASTER

The type of the machine group to be queried:

  • MASTER: MASTER instance Group
  • CORE: CORE instance Group
  • TASK: compute instance Group
Note At present MASTER and CORE Support setting only one group.
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 category of the system disk of the machine Group. Values are as follows:

  • CLOUD: basic CLOUD disk
  • CLOUD_EFFICIENCY: Ultra disk
  • CLOUD_SSD: Cloud SSD
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 instance. You can call DescribeRegions To 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 ID of the zone. You can call DescribeZones You can call this operation to view zones in an 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

Specifies whether to assign a public IP address to the EMR cluster. If the feature is enabled, 8 MB of bandwidth is allocated by default.

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 30

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 ChargeType is set to PrePaid.

AutoRenew Boolean No false

Whether a subscription cluster is auto-renewal. Values are as follows:

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

Indicates whether to automatically pay the bill. Valid values are as follows:

  • true: automatic payment is enabled.
  • false: disables automatic payment.
VpcId String No vpc-bp1l4urd87xlh7i4b****

The ID of the VPC. Set this parameter when NetType is set to vpc.

VSwitchId String No vsw-bp10tvjyc77psy0z5****

The ID of the VSwitch. Set this parameter when NetType is set to vpc.

NetType String No vpc

The type of the 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

Specifies whether the cluster is a high-availability cluster. A high-availability cluster requires two master nodes.

UseLocalMetaDb Boolean No true

Specifies whether to use the local Hive metadatabase.

IoOptimized Boolean No true

Specifies whether to enable I/O Optimization. Values are as follows:

  • true: I/O optimization is enabled.
  • false: I/O optimization is not enabled.
SshEnable Boolean No true

Indicates whether SSH is enabled. Valid values:

  • true: enables SSH.
  • false: SSH is not enabled.
InstanceGeneration String No ecs-3

The instance type.

MasterPwd String No pwd

The SSH password that is used to access a master node. The password must be 8 to 30 characters in length and must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters.

KeyPairName String No test_pair

The key pair.

MetaStoreType String No local

The unified metadata type. Values are as follows:

  • local: internal metadata of the cluster
  • unified: unified metadata
  • user_rds: User-created 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 service name.

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. Valid values:

  • 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 30

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

Specifies whether to automatically renew the subscription to instances in host group N.

HostGroup.N.VSwitchId String No vsw-bp10tvjyc77psy0z5****

The ID of the vSwitch in the specified VPC.

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 scope of script execution. Valid values:

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

The script execution time. Values are as follows:

  • BEFORE_INSTALL: run before the service is installed.
  • AFTER_STARTED: The task is executed after the service is started.
BootstrapAction.N.ExecutionFailStrategy String No FAILED_BLOCKED

The execution policy for failed scripts. The values are as follows:

  • FAILED_BLOCKED: the workflow is turned to manual for processing after a failure occurs.
  • FAILED_CONTINUE: continue 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 the cluster is a high-security cluster.

RelatedClusterId String No C-D7958B72E59B****

The ID of the associated EMR cluster when you create a gateway cluster.

WhiteListType String No IP

The whitelist type. Values are as follows:

  • IP : IP whitelist Group
  • SecurityGroup : Security Group
AuthorizeContent String No N/A

A reserved parameter.

Tag.N.Key String No TestKey

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

Tag.N.Value String No TestValue

The tag value of the EMR instance and ECS instance on the node. Valid values of N: 1 to 20. The tag value can be an empty string. Valid values of the tag value: 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 instances and ECS node instances belong.

Response parameters

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

The ID of the cluster.

CoreOrderId String 0

The order ID of the core node.

EmrOrderId String 0

The ID of the E-MapReduce order.

MasterOrderId String 0

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"
}

Error codes

HttpCode Error code Error message Description
403 Forbbiden User not authorized to operate on the specified resource. The error message returned because you are not authorized to manage the specified resource. Contact the Apsara Stack tenant account for authorization.
400 ECSInfo.DiskSize.TooSmall disk size per ecs should be >= 80GB. The error message returned because the disk capacity cannot meet the current requirements. Extend the disk capacity.
400 HighAvailability.is.not.permitted.in.this.emr.version HighAvailability parameter is not permitted in this emr version The error message returned because the EMR version does not support HA clusters. Change the EMR version.
400 Create.PrePaid.Cluster.Failed Create prepaid cluster order failed:[%s] The error message returned because you have failed to create the subscription cluster order.
400 ECSInfo.ECSOrder.INVALID invalid parameter format(ecsorderinfo) The error message returned because one or more parameters are invalid when you created an ECS instance.
400 Ecs.InstanceType.NotSupported Unsupported ecs instance type [%s] at zone [%s] with IO-optimized [%s] and network type [%s]. The error message returned because the specified instance type is not supported. Specify a valid instance type.
400 DiskType.Invalid Unsupported disk type [%s] at zone [%s] with IO-optimized [%s] and network type [%s]. The error message returned because the disk type is not supported. Change the disk type.
400 Unsupported.ZoneId Zone [%s] is invalid or not supported in emr The error message returned because EMR cannot be deployed in the specified zone. Change the zone.
400 ECSInfo.DiskSize.TooBig Disk size exceeded max value limit. The error message returned because the disk capacity exceeds the limit. Reduce the disk capacity.
400 ECSInfo.DiskCount.ExceedLimit Disk count exceeded max value limit. The error message returned because the number of disks exceeds the limit. Reduce the number of disks.
400 ECSInfo.NodeType.Unsupported the specify node type is unsupport. The error message returned because the specified node type is not supported. Change the node type.
400 Must.Specify.MasterNode master node is mandatory. The error message returned because you have not specified the master node.
400 Only.Support.One.Master Only one master node is supported in emr cluster The error message returned because only one master node is supported in the EMR cluster.
400 Have.Orders.Wait.For.Pay Have other orders wait for pay The error message returned because you need to pay for other orders.
400 Unsupported.IoOptimization.Option IO-optimization option [%s] is not supported at zone [%s] and network type [%s]. The error message returned because the network type in the zone does not support I/O optimized instances.
400 Unsupported.EcsInstanceGeneration Unsupported ecs instance generation [%s] at zone [%s] with IO-optimized [%s] and network type [%s]. The error message returned because the network type in the zone does not support I/O optimized instances.
403 EMR.Version.OptionSoftWare.UnSupported only emr version >= 2.0.0 support optionsoftware. The error message returned because you cannot configure optional software. Only EMR 2.0.0 or later versions support optional software.
500 InternalError The request processing has failed due to some unknown error. The error message returned because the request processing has failed due to an internal error. Submit a ticket.

The port number of a client that accesses a Error CenterFor more information, see error codes.