Create

To create a cluster with asynchronous operation, it is necessary to query the cluster state using describeCluster to determine whether the cluster has been successfully created. The entire process can take 5 minutes or more, and periodic queries are required to obtain the status.

Status: The C_PROCESSING is received by the server and the cluster is being processed; C_RUNNING has started running normally for the cluster and is available, indicating the cluster is created successfully. C_FAILED failed.

Parameters: CreateClusterRequest

  • name: String. Cluster name, for identification by user.
  • region: String. Default ec2.cn-north-1.
  • purpose: String. Default emr.
  • keypar: String. Used to log into master node.
  • groups: List<AddInstanceGroupRequest>. Instance groups, including 4 roles, master, control, core, task. Each type must indicate type, requestedInstanceCount. type refers to the virtual machine type. The list of types is obtained from the server side. requestedInstanceCount refers to the number of virtual machines created.
    • master: required.
      • type: String.
      • requestedInstanceCount: int. Fixed value 1
    • control: required.
      • type: String.
      • requestedInstanceCount: int. Fixed value 3
    • core: required.
      • type: String.
      • requestedInstanceCount: int. Greater than or equal to 1
    • task: optional.
      • type: InstanceGroupRole.TASK.
      • requestedInstanceCount: int. Greater than or equal to 0
  • Other: adding jobs at startup will be supported in the future, but is currently not supported.

Return: CreateClusterResponse

  • name: String. Same as the name in the parameter
  • clusterId : String. Allocated by server side, unique identification, describe, list, terminate are used.
  • groupIds: List<String>. Corresponds to parameter groups, including the groupId of each group.
  • Other

Errors

  • Internal server error
  • Parameter error
  • Insufficient permissions