edit-icon download-icon

Create a cluster

Last Updated: Dec 28, 2017

Create a cluster.

Request parameters

Field Type Required? Default Value Description
Name String Yes None Cluster name. Length: 1 to 64 characters. Only Chinese characters, letters, numbers, hyphens (-) and underscores (_) are allowed.
RegionId String Yes None Currently supported Region.
ZoneId String No None Supported zones in the Region. You can view the create page to confirm.
LogEnable Boolean No None Enable log storage? To use this function, ensure you have activated OSS.
LogPath String No, required when LogEnable==true None The path of the logs saved on OSS, similar to oss://bucketname/dir.
SecurityGroupId String No None Any security group Id. You can create one in the ECS and then use it. Note: If you are using an existing security group, the default security group policy will apply: Port 22 for incoming requests only and all ports for outgoing requests.
SecurityGroupName String No None If the security group ID is not specified, a new security group will be created using this name. After the cluster is created, you can see the security group ID in the cluster details. Note: The default security group policy will apply to the security group: Port 22 for incoming requests only and all ports for outgoing requests.
IsOpenPublicIp Boolean No True Enable public IP address? If yes, 8 MB bandwidth will be available by default.
EmrVer String Yes None E-MapReduce version number, including “emr-1.0.0”, “emr-1.1.0”, and “emr-1.2.0”.
ClusterType String Yes None Cluster type. It can be HADOOP.
HighAvailabilityEnable Boolean No False Enable high availability mode? If yes, 2 master nodes are required to be active.
MasterPwdEnable Boolean No None Whether to set the root password of the master node.
MasterPwd String No. Required if MasterPwdEnable==true None The ECS password rule must be met: 8 - 30 characters and containing any three types at the same time (upper-case letters, lower-case letters, numbers and special symbols).
EcsOrder  String  Yes  None  The ECS information contained in the cluster, in JSON format. EcsOrder.
ChargeType String Yes None Billing method: Pay-As-You-Go or Subscription.
Period Integer No, required when ChargeType==Subscription None Duration of subscription. Unit: month (1,2,3,4,5,6,7,8,9,12,24,36).
BootstrapActions List BootstrapAction No None Bootstrap action list. A maximum of 16 actions are allowed. Otherwise, only the first 16 actions are retained.
Configurations String No None Provide an OSS file path and the file content can be found in the User Manual.
VpcId String No None vpc ID.
VSwitchId String No None ID of the vswitch in VPC.
NetType String No Classic classic/vpc, classic by default.
IoOptimized Boolean No True Enable I/O optimization? The default value is “true”.
instanceGeneration String No None ECS series, and the value is ecs-1 or ecs-2.

Returned parameters

Field Type Description
ClusterId String Cluster Id.
EmrOrderId String E-MapReduce service charge order ID.
MasterOrderId String Master node ECS order ID.
CoreOrderId String Core node ECS order ID.


Request example

  1. https://emr.aliyuncs.com/?Action=CreateCluster
  2. &Name=smokeTestCreateCluster1
  3. &ClusterType=HADOOP
  4. &HighAvailabilityEnable=false
  5. &SecurityGroupId=sg-234r6xoqe
  6. &LogEnable=false
  7. &EmrVer=EMR+1.1.0
  8. &ZoneId=cn-hangzhou-b
  9. &IsOpenPublicIp=true
  10. &RegionId=cn-hangzhou
  11. &MasterPwdEnable=false
  12. &VpcId=vpc-239kkz237
  13. &VSwitch=vsw-234iqq7ae
  14. &NetType=vpc
  15. &EcsOrder=[{"nodeCount":1,"nodeType":"master","instanceType":"ecs.n1.large","diskType":"CLOUD_EFFICIENCY","diskCapacity":80}]
  16. &Public request parameters

Returned format

JSON format

  1. {
  2. "RequestId": "34B08619-2636-49F9-AB4E-CD8D347B1E07",
  3. "InstanceId": "C-13A570B821D4BAB3"
  4. }
Thank you! We've received your feedback.