You need to enable JavaScript to run this app.
文档中心
E-MapReduce

E-MapReduce

复制全文
下载 pdf
集群管理
CreateCluster - 创建集群
复制全文
下载 pdf
CreateCluster - 创建集群

创建集群

使用说明

调用 CreateCluster,创建一个 E-MapReduce(EMR)集群。

注意事项

已拥有火山引擎账号并开通 EMR 权限。

请求说明

请求方式:POST
请求地址:https://open.volcengineapi.com/?Version=2023-08-15&Action=CreateCluster

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。

参数
类型
是否必填
示例值
描述
Action
String
是

CreateCluster

要执行的操作,取值:CreateCluster。

Version
String
是

2023-08-15

API的版本,取值:2023-08-15。

Tags
Array of Object
否

[{"Key":"env","Value":"test"}]

集群的标签列表

ProjectName
String
否

default

ProjectName

ClusterName
String
是

emr-xxx

集群名称

ClusterType
String
是

Hadoop
Presto
Trino
Stream-Kafka
Stream-Flink
HBase
OpenSearch
StarRocks
TensorFlow
Doris
Pulsar
ClickHouse
ZooKeeper

集群类型

ReleaseVersion
String
是

3.7.0

集群版本

DeployMode
String
否

SIMPLE、HIGH_AVAILABLE

部署模式

SecurityMode
String
否

SIMPLE,KERBEROS

安全模式

HistoryServerMode
String
否

LOCAL,
PHS

HistoryServer模式,LOCAL将活动数据存储于集群内,PHS将活动数据存储于集群外

ChargeType
String
是

PRE、POST

付费类型

ChargePreConfig
Object
否

{
"ChargeType": "PRE",
"ChargePeriodUnit": "Month",
"ChargePeriod": 1,
"AutoRenew": true,
"AutoRenewPeriodUnit": "Month",
"AutoRenewPeriod": 1
}

包月的配置参数,当chargeType=PRE时,必选

VpcId
String
是

vpc-xxx

Vpc ID

SecurityGroupId
String
是

sg-xxx

集群全局安全组ID,所有节点组下的ecs都会加入该安全组

NodeAttribute
Object
是

{
"ZoneId": "cn-beijing-b",
"EcsIamRole": "VEECSforEMRRole"
}

node全局属性

NodeGroupAttributes
Array of Object
是

{
"ZoneId": "cn-beijing-b",
"SubnetIds": [
"subnet-mjl0el0a47i85smt1bp03q8e"
],
"EcsInstanceTypes": [
"ecs.g3i.2xlarge"
],
"SystemDisk": {
"VolumeType": "ESSD_FlexPL",
"Size": 80
},
"DataDisks": [
{
"VolumeType": "ESSD_FlexPL",
"Size": 80,
"Count": 1
}
],
"EcsKeyPairName": "kamui-autotest",
"Bandwidth": 8,
"ChargeType": "PRE",
"EcsPassword": "",
"NodeGroupType": "MASTER",
"NodeGroupName": "OpenApi-MasterGroup",
"NodeCount": 3,
"WithPublicIp": false
},...

节点组属性列表

ApplicationNames
Array of String
否

[
"HBASE",
"CELEBORN",
"FLINK",
"TRINO",
"DOLPHIN_SCHEDULER",
"ICEBERG",
"DELTALAKE",
"AIRFLOW",
"HUE",
"KYUUBI",
"SQOOP",
"IMPALA",
"KUDU",
"PHOENIX",
"RANGER",
"FLUME",
"GTS",
"PROTON",
"HUDI"
]

集群安装的服务名称列表。

ApplicationExtras
Array of Object
否

{xxx}

集群服务的扩展信息列表,包括服务的自定义配置项、服务组件的自定义部署拓扑设置,以及服务的元数据连接配置信息

BootstrapScripts
Array of Object
否

[{
"ScriptName": "OpenApi54138",
"ScriptType": "BOOTSTRAP",
"ScriptPath": "tos://emr-autotest/deiwu/test.sh",
"ScriptArgs": null,
"Priority": 1,
"EffectiveScope": {"EffectiveType": "CLUSTER"},
"ExecutionMoment": "AFTER_APPLICATION_STARTED",
"ExecutionFailStrategy": "FAILED_CONTINUE"
}]

集群的引导脚本列表

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
NodeGroupId
String

xxx

节点组ID

ClusterId
String

emr-xxx

集群ID

OperationId
String

xxx

集群操作ID

ResultData
Object

null

结果数据

请求示例

{
    "RequestId": null,
    "RegionId": "cn-beijing",
    "UserId": 0,
    "AccountId": xxx,
    "ProjectName": "default",
    "ClusterName": "OpenApiHadoop3.7.0-xxx",
    "ClusterType": "Hadoop",
    "ReleaseVersion": "3.7.0",
    "DeployMode": "HIGH_AVAILABLE",
    "SecurityMode": "SIMPLE",
    "HistoryServerMode": "LOCAL",
    "ChargeType": "POST",
    "ChargePreConfig": null,
    "VpcId": "vpc-xxx",
    "SecurityGroupId": "sg-xxx",
    "NodeAttribute": {
        "ZoneId": "cn-beijing-b",
        "EcsIamRole": null,
        "LoginUserName": null
    },
    "NodeGroupAttributes": [
        {
            "ZoneId": "cn-beijing-b",
            "SubnetIds": [
                "subnet-xxx"
            ],
            "EcsInstanceTypes": [
                "ecs.g3i.2xlarge"
            ],
            "SystemDisk": {
                "Size": 80,
                "VolumeType": "ESSD_FlexPL"
            },
            "DataDisks": [
                {
                    "Size": 80,
                    "VolumeType": "ESSD_FlexPL",
                    "Count": 1
                }
            ],
            "EcsKeyPairName": "kamui-autotest",
            "Bandwidth": 8,
            "ChargeType": "POST",
            "EcsPassword": "",
            "NodeGroupType": "MASTER",
            "NodeGroupName": "OpenApi-MasterGroup",
            "NodeCount": 3,
            "WithPublicIp": false
        },
        {
            "ZoneId": "cn-beijing-b",
            "SubnetIds": [
                "subnet-xxx"
            ],
            "EcsInstanceTypes": [
                "ecs.g3i.2xlarge"
            ],
            "SystemDisk": {
                "Size": 80,
                "VolumeType": "ESSD_FlexPL"
            },
            "DataDisks": [
                {
                    "Size": 80,
                    "VolumeType": "ESSD_FlexPL",
                    "Count": 1
                }
            ],
            "EcsKeyPairName": "kamui-autotest",
            "Bandwidth": 8,
            "ChargeType": "POST",
            "EcsPassword": "",
            "NodeGroupType": "CORE",
            "NodeGroupName": "OpenApi-CoreGroup-e471d",
            "NodeCount": 3,
            "WithPublicIp": false
        },
        {
            "ZoneId": "cn-beijing-b",
            "SubnetIds": [
                "subnet-xxx"
            ],
            "EcsInstanceTypes": [
                "ecs.g3i.2xlarge"
            ],
            "SystemDisk": {
                "Size": 80,
                "VolumeType": "ESSD_FlexPL"
            },
            "DataDisks": [
                {
                    "Size": 80,
                    "VolumeType": "ESSD_FlexPL",
                    "Count": 1
                }
            ],
            "EcsKeyPairName": "kamui-autotest",
            "Bandwidth": 8,
            "ChargeType": "POST",
            "EcsPassword": "",
            "NodeGroupType": "TASK",
            "NodeGroupName": "OpenApi-TaskGroup-4f631",
            "NodeCount": 1,
            "WithPublicIp": "false"
        }
    ],
    "ApplicationNames": [
        "HBASE",
        "CELEBORN",
        "FLINK",
        "TRINO",
        "DOLPHIN_SCHEDULER",
        "ICEBERG",
        "DELTALAKE",
        "AIRFLOW",
        "HUE",
        "KYUUBI",
        "SQOOP",
        "IMPALA",
        "KUDU",
        "PHOENIX",
        "RANGER",
        "FLUME",
        "GTS",
        "PROTON",
        "HUDI"
    ]
}

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20231205161805524BB2FD6ABAxxx,
        "Action": "CreateCluster",
        "Version": "2023-08-15",
        "Service": "emr",
        "Region": "cn-beijing",
        "Error": null,
        "Deprecated": false
    },
    "Result": {
        "OperationId": "xxx",
        "ClusterId": "emr-xxx",
        "ResultData": null
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
IllegalOperationForCluster

The cluster id {clusterId} does not support the operation

非法操作,该集群不支持该操作

400
InvalidRequest

Access Denied {clusterId}

对该集群没有权限

400
InvalidClusterId

cluster id {clusterId} not found

集群不存在

400
IllegalChargePreConfig

ChargePreConfig must not be null when chargeType is pre

非法的包年包月信息,当chargeType是PRE时,ChargePreConfig必须不为空

400
IllegalClusterGroupQuantity

Illegal nodes number {0} of node group {1}

非法的节点组节点数,如高可用Master节点组中节点数必须>1

400
IllegalClusterService

Illegal service {0}

非法的集群应用信息

400
IllegalClusterServiceComponent

Illegal service component {0}

非法的集群组件信息

400
IllegalClusterServiceComponentInstance

Illegal service component instance {0}

非法的集群组件实例信息

400
IllegalConnDbEngineVersion

Illegal conn dbEngine version {0} of service {1}

非法的RDS版本,对于AirFlow等组件,要求RDS版本>=8.0

400
IllegalRoleTrustPolicy

Illegal role {0} trust policy

非法的IAM角色户型策略

400
IllegalVpcOrVsw

Illegal vpc {0} or vsw {1}

非法的VpcOrVsw值

400
InsufficientClusterServiceLayout

Insufficient number for service component {0} {1}

非法的集群服务布局

400
LackEcsTrustPolicy

Lack Volc_ECS or emr trust policy for role {0}

传入的IAM角色缺少对Volc_ECS or emr的互信策略

400
UnSupportedCoreAndTaskDiffSpecification

UnSupported add heterogeneous specification {0} when using gpu

不支持GPU异构

400
UnSupportedDiskCategory

UnSupported DiskCategory {0}

不支持的磁盘类型

400
UnSupportedMismatchedSpecification

UnSupported mismatched core specifications {0} and task specifications {1} when use gpu

不支持Core和Task节点组GPU规格异构

400
Insufficient.Balance

The request is denied due to the lack of balance.

余额不足,请求被拒绝

400
100007

内部服务异常

内部服务异常

400
102004

获取Admin配置 ClusterTypeNotExist 错误

获取Admin配置 ClusterTypeNotExist 错误

400
116000

集群所选择的安全组不符合集群使用规范,建议使用其他安全组或更改安全组规则后进行重试

集群所选择的安全组不符合集群使用规范,建议使用其他安全组或更改安全组规则后进行重试

400
InvalidKeyPair.NotFound

The specified KeyPair does not exist.

The specified KeyPair does not exist.

400
clusterName

clusterName It can only contain letters, Chinese characters, numbers, underscores (_), dots (.), and dashes (-)

clusterName It can only contain letters, Chinese characters, numbers, underscores (_), dots (.), and dashes (-)

400
clusterType

clusterType must not be blank

clusterType must not be blank

400
nodeAttribute

nodeAttribute must not be null

nodeAttribute must not be null

400
nodeGroupAttributes

nodeGroupAttributes size must be between 1 and 2147483647

nodeGroupAttributes size must be between 1 and 2147483647

400
vpcId

vpcId must not be blank

vpcId must not be blank

最近更新时间:2026.09.21 15:57:12
这个页面对您有帮助吗?
有用
有用
无用
无用