tencent cloud

Elastic MapReduce

  • Release Notes and Announcements
  • Product Introduction
  • Purchase Guide
    • EMR on CVM Billing Instructions
    • EMR on TKE Billing Instructions
    • EMR Serverless HBase Billing Instructions
    • EMR Serverless TCBase Billing Overview
  • Getting Started
  • EMR on CVM Operation Guide
    • Planning Cluster
    • Administrative rights
    • Configuring Cluster
    • Managing Cluster
    • Managing Service
    • Monitoring and Alarms
    • TCInsight
  • EMR on TKE Operation Guide
  • EMR Serverless HBase Operation Guide
  • EMR Serverless TCBase Operation Guide
  • EMR Development Guide
    • Hadoop Development Guide
    • Spark Development Guide
    • HBase Development Guide
    • Phoenix on Hbase Development Guide
    • Hive Development Guide
    • Presto Development Guide
    • Sqoop Development Guide
    • Hue Development Guide
    • Oozie Development Guide
    • Flume Development Guide
    • Kerberos Development Guide
    • Knox Development Guide
    • Alluxio Development Guide
    • Kylin Development Guide
    • Livy Development Guide
    • Kyuubi Development Guide
    • Zeppelin Development Guide
    • Hudi Development Guide
    • Superset Development Guide
    • Impala Development Guide
    • Druid Development Guide
    • TensorFlow Development Guide
    • Kudu Development Guide
    • Ranger Development Guide
    • Kafka Development Guide
    • StarRocks Development Guide
    • Flink Development Guide
    • JupyterLab Development Guide
    • MLflow Development Guide
  • Practical Tutorial
    • Practice of EMR on CVM Ops
    • Data Migration
    • Practical Tutorial on Custom Scaling
  • API Documentation
    • History
    • Introduction
    • API Category
    • Making API Requests
    • Cluster Resource Management APIs
    • Cluster Service APIs
    • User Management APIs
    • Information Query APIs
    • Information Query APIs
    • Scaling APIs
    • Configuration APIs
    • Other APIs
    • Cluster Lifecycle APIs
    • Serverless HBase APIs
    • YARN Resource Scheduling APIs
    • Data Types
    • Error Codes
  • FAQs
    • EMR on CVM
  • Service Level Agreement
  • Contact Us

CreateInstance

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-10-10 14:59:17

1. API Description

Domain name for API request: emr.intl.tencentcloudapi.com.

This API is used to create an EMR cluster.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateInstance.
Version Yes String Common Params. The value used for this API: 2019-01-03.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ProductId Yes Integer

Product ID. Different product IDs indicate different EMR product versions. Valid values:
51: STARROCKS-V1.4.0
54: STARROCKS-V2.0.0
27: KAFKA-V1.0.0
50: KAFKA-V2.0.0
16: EMR-V2.3.0
20: EMR-V2.5.0
30: EMR-V2.6.0
38: EMR-V2.7.0
25: EMR-V3.1.0
33: EMR-V3.2.1
34: EMR-V3.3.0
37: EMR-V3.4.0
44: EMR-V3.5.0
53: EMR-V3.6.0
58: EMR-3.6.1
59: EMR-serverless-1.0.0
60: EMR-TKE-1.1.0
61: SR-V2.1.0
62: SR-V2.1.0-SharedData
63: SR-V2.1.0.tlinux
64: unified metadata management project
65: EMR-TKE-AI-1.0.0
66: RSS-1.0.0
67: SR-V2.2.0
68: SR-V2.2.0.tlinux
69: EMR-AI-1.1.0
70: SR-V2.2.1
71: EMR-3.7.0
72: EMR-serverless-1.0.1
73: KAFKA-2.0.1
74: SR-V2.2.2
75: EMR-TKE-AI-1.1.0
76: EMR-V3.7.1
77: SERVERLESS-TCBASE-1.0.0
78: EMR-V3.6.2
79: STARROCKS-V2.2.2
80: EMR-AI-V1.1.1

Software.N Yes Array of String

List of deployed components. Different EMR product IDs correspond to different optional component lists (ProductId: For details about its meaning, see the ProductId request parameter). For details about how to query optional component lists for different product versions, see Component Version.
Example values: hive and flink.

SupportHA Yes Integer

Whether to enable high availability for the node. Valid values:

  • 0: disables high availability for the node.
  • 1: enables high availability for the node.
  • InstanceName Yes String

    Instance name.

  • The value can contain 6 to 36 characters.
  • Only Chinese characters, letters, digits, hyphens (-), and underscores (_) are allowed.
  • PayMode Yes Integer

    Instance billing mode. Valid values:

  • 0: pay-as-you-go
  • 1: yearly/monthly subscription
  • TimeSpan Yes Integer

    Instance purchase duration, which is used together with TimeUnit.

  • When TimeUnit is set to s, this parameter can only be set to 3600, indicating a pay-as-you-go instance.
  • When TimeUnit is set to m, the value set for this parameter indicates the subscription duration of the instance. For example, 1 indicates a one-month subscription.
  • TimeUnit Yes String

    Time unit for purchasing instances. Valid values:

  • s: indicates seconds. When PayMode is set to 0, TimeUnit can only be set to s.
  • m: indicates months. When PayMode is set to 1, TimeUnit can only be set to m.
  • LoginSettings Yes LoginSettings

    Instance login settings. This parameter is used to set the login method for the purchased node, either the password or key.

  • When a key is set, the password is only used to log in to the native WebUI shortcut entry for the component.
  • When no key is set, the password is used to log in to the purchased node as well as the native WebUI shortcut entry for the component.
  • VPCSettings No VPCSettings

    VPC-related information configuration. This parameter can be used to specify the VPC ID, subnet ID, and so on.

    ResourceSpec No NewResourceSpec

    Node resource specifications.

    COSSettings No COSSettings

    Specifies the parameters to be set for enabling COS access.

    Placement No Placement

    Location of the instance. This parameter can be used to specify attributes such as the AZ and associated project of the instance.

    SgId No String

    ID of the security group to which the instance belongs, for example, sg-xxxxxxxx. This parameter can be obtained by calling the SecurityGroupId field in the response result of DescribeSecurityGroups.

    PreExecutedFileSettings.N No Array of PreExecuteFileSettings

    Bootstrap operation script settings.

    AutoRenew No Integer

    Whether a yearly/monthly subscription instance is automatically renewed. Valid values:

  • 0: no
  • 1: yes
  • ClientToken No String

    Unique random identifier, which is valid for five minutes and needs to be specified by the caller. This prevents the client from repeatedly creating resources. Example value: a9a90aa6---****-fae36063280.

    NeedMasterWan No String

    Whether to enable public network access for the cluster Master node. Valid values:

  • NEED_MASTER_WAN: yes
  • NOT_NEED_MASTER_WAN: no
  • By default, public network access is enabled for the cluster Master node.
    RemoteLoginAtCreate No Integer

    Whether to enable remote public network login, that is, port 22. If SgId is passed, this parameter is invalid.

    CheckSecurity No Integer

    Whether the security cluster is enabled. Valid values: 0 (no) and values other than 0 (yes).

    ExtendFsField No String

    Specifies the external file system to be accessed.

    Tags.N No Array of Tag

    List of tag descriptions. When this parameter is specified, tags are bound to the corresponding instance.

    DisasterRecoverGroupIds.N No Array of String

    List of dispersed placement group IDs. Currently, only one ID can be specified.
    This parameter can be obtained by calling the SecurityGroupId field in the response result of DescribeSecurityGroups.

    CbsEncrypt No Integer

    CBS encryption disk at the cluster level. Valid values: 0 (not encrypted) and 1 (encrypted). Default value: 0.

    MetaType No String

    Hive shared metadata database type. Valid values:

  • EMR_DEFAULT_META: created by the cluster by default
  • EMR_EXIST_META: EMR-MetaDB specified by the cluster
  • USER_CUSTOM_META: custom MetaDB used by the cluster
  • UnifyMetaInstanceId No String

    EMR-MetaDB instance.

    MetaDBInfo No CustomMetaInfo

    Custom MetaDB information.

    ApplicationRole No String

    Custom application role.

    SceneName No String

    Scenario-based values:
    Hadoop-Kudu
    Hadoop-Zookeeper
    Hadoop-Presto
    Hadoop-Hbase

    ExternalService.N No Array of ExternalService

    Shared component information.

    VersionID No Integer

    If this parameter is set to 0, MultiZone, MultiDeployStrategy, and MultiZoneSettings are disabled. If this parameter is set to 1, ResourceSpec is deprecated and MultiZoneSettings is used.

    MultiZone No Boolean

    true: indicates that cross-AZ deployment is enabled. It is only a user parameter for cluster creation and cannot be adjusted subsequently.

    MultiZoneSettings.N No Array of MultiZoneSetting

    Specifications of node resources. Set one for each AZ. The first is the primary AZ, the second is the secondary AZ, and the third is the arbitration AZ. If cross-AZ is disabled, the length only needs to be 1.

    CosBucket No String

    COS bucket path, which is used when a StarRocks compute-storage separation cluster is created.

    NodeMarks.N No Array of NodeMark

    Node flag information, which is currently only provided for the Terraform platform.

    LoadBalancerId No String

    CLB id

    DefaultMetaVersion No String

    Database type. Valid values: mysql8/tdsql8.

    NeedCdbAudit No Integer

    Whether to enable audit. Valid values: 0 (no) and 1 (yes).

    SgIP No String

    Source IP address, which is specified in the security group.

    PartitionNumber No Integer

    Partition of a partition placement group.

    WebUiVersion No Integer

    Service UI address.

    Enumeration values:

    • 0: Service UI address. Only one service UI address is returned.
    • 1: Service UI address. If the service has multiple UI addresses, all results are returned, such as Impalad, StateStore, and Catalogd of Impala.

    Default value: 0.

    CbsSysEncrypt No Integer

    Whether to enable cluster-level CBS system disk encryption. Valid values: 0 (no) and 1 (yes).

    3. Output Parameters

    Parameter Name Type Description
    InstanceId String

    Instance ID.

    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Creating an Instance

    Input Example

    POST / HTTP/1.1
    Host: emr.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateInstance
    <Common request parameters>
    
    {
        "ResourceSpec": {
            "MasterResourceSpec": {
                "StorageType": 5,
                "DiskType": "CLOUD_PREMIUM",
                "Cpu": 4,
                "DiskSize": 100,
                "MemSize": 8192,
                "RootSize": 100,
                "Spec": "CVM.S2"
            },
            "CoreCount": 2,
            "CoreResourceSpec": {
                "StorageType": 5,
                "DiskType": "CLOUD_PREMIUM",
                "Cpu": 4,
                "DiskSize": 100,
                "MemSize": 8192,
                "RootSize": 100,
                "Spec": "CVM.S2"
            },
            "MasterCount": 1
        },
        "Placement": {
            "ProjectId": 0,
            "Zone": "ap-guangzhou-3"
        },
        "SupportHA": 0,
        "TimeSpan": 3600,
        "VPCSettings": {
            "SubnetId": "subnet-sf1314",
            "VpcId": "vpc-dfa11"
        },
        "LoginSettings": {
            "Password": "tencent@cloud123"
        },
        "PayMode": 0,
        "AutoRenew": 0,
        "TimeUnit": "s",
        "Software": [
            "zookeeper-3.4.9",
            "hadoop-2.8.4",
            "knox-1.2.0"
        ],
        "InstanceName": "emr test",
        "ProductId": 4
    }

    Output Example

    {
        "Response": {
            "RequestId": "d830face-6587-4263-8ab0-56bda265787d",
            "InstanceId": "emr-xxxx"
        }
    }

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation Operation failed.
    FailedOperation.DuplicateOrderNotAllowed Duplicate order. Please check the EMR console.
    FailedOperation.GetCvmServerFailed Failed to call the CVM service.
    InternalError Internal error.
    InternalError.AccountCgwError Internal service call exception.
    InternalError.CamCgwError Internal service call exception.
    InternalError.CamError Internal service call exception.
    InternalError.CbsCgwError Internal service call exception.
    InternalError.CbsError Internal service call exception.
    InternalError.CdbCgwError Internal service call exception.
    InternalError.CdbError Internal service call exception.
    InternalError.CheckQuotaErr Insufficient CVM or CBS resources, or invalid software.
    InternalError.ConfigCgwError Internal service call exception.
    InternalError.CvmError Internal service call exception.
    InternalError.KmsError Internal service call exception.
    InternalError.ProjectCgwError Internal service call exception.
    InternalError.SgError An exception occurred when the security group API is called.
    InternalError.TagError Internal service call exception.
    InternalError.TradeCgwError Internal service call exception.
    InternalError.VpcCgwError Internal service call exception.
    InternalError.VpcError Internal service call exception.
    InternalError.WoodServerError Internal service call exception.
    InvalidParameter Parameter error.
    InvalidParameter.HALessMasterCount Parameter error.
    InvalidParameter.IncorrectCommonCount Invalid Common node quantity.
    InvalidParameter.IncorrectMasterCount Invalid Master node quantity.
    InvalidParameter.InvalidAutoRenew Invalid auto-renewal flag.
    InvalidParameter.InvalidClientToken Invalid ClientToken.
    InvalidParameter.InvalidComponent Invalid component.
    InvalidParameter.InvalidCoreCount Invalid Core node quantity.
    InvalidParameter.InvalidCosBucket Invalid CosBucket.
    InvalidParameter.InvalidCosFileURI Invalid CosFileUri parameter value.
    InvalidParameter.InvalidDiskSize Invalid disk size.
    InvalidParameter.InvalidExtendField Invalid CustomConfig parameter value.
    InvalidParameter.InvalidInstanceName Invalid cluster name.
    InvalidParameter.InvalidInstanceType Invalid instance type.
    InvalidParameter.InvalidLoadBalancer Invalid LoadBalancerId.
    InvalidParameter.InvalidLoginSetting Invalid login settings.
    InvalidParameter.InvalidMetaDataJdbcUrl Invalid metadata database URL.
    InvalidParameter.InvalidMetaType Invalid metadata table type.
    InvalidParameter.InvalidPassword Invalid password.
    InvalidParameter.InvalidPaymode Invalid payment type.
    InvalidParameter.InvalidPreExecutedFile Invalid bootstrap operation script.
    InvalidParameter.InvalidProductId Invalid product ID.
    InvalidParameter.InvalidProjectId Invalid project ID.
    InvalidParameter.InvalidResourceSpec Invalid resource specifications.
    InvalidParameter.InvalidSecuritySupport This EMR version does not support enabling security mode.
    InvalidParameter.InvalidSercurityGrpupId Invalid security group ID.
    InvalidParameter.InvalidServiceName Invalid service name.
    InvalidParameter.InvalidSoftDeployInfo The InvalidSoftDeployInfo parameter is invalid or incorrect.
    InvalidParameter.InvalidSoftInfo The SoftInfo parameter is invalid.
    InvalidParameter.InvalidSoftWare Parameter error.
    InvalidParameter.InvalidSoftWareName Invalid software name.
    InvalidParameter.InvalidSoftWareVersion Invalid software version.
    InvalidParameter.InvalidSubnetId Invalid subnet ID.
    InvalidParameter.InvalidSupportHA Invalid high availability parameter.
    InvalidParameter.InvalidTimeSpan Invalid timespan.
    InvalidParameter.InvalidTimeUnit Invalid TimeUnit.
    InvalidParameter.InvalidUnifyMeta Invalid unified metadata database.
    InvalidParameter.InvalidVpcId Invalid VPC ID.
    InvalidParameter.InvalidZone Invalid AZ.
    InvalidParameter.NotContainMustSelectSoftware Invalid parameter. It does not contain required components.
    InvalidParameter.PayModeResourceNotMatch The payment mode does not match resources.
    InvalidParameter.SoftwareNotInProduct Invalid product components exist.
    InvalidParameter.UngrantedPolicy The policy is authorization.
    InvalidParameter.UngrantedRole Role not authorized.
    InvalidParameter.ZoneResourceNotMatch The AZ does not match resources.
    InvalidParameterValue Parameter value error.
    LimitExceeded.SecurityGroupNumLimitExceeded The number of security groups exceeds the limit.
    MissingParameter Missing parameter error.
    ResourceInsufficient.DiskInsufficient The specifications of the hard disk do not meet the requirements.
    ResourceInsufficient.InstanceInsufficient The node specifications are not supported or have been sold out.
    ResourceNotFound.SubnetNotFound The corresponding subnet cannot be found.
    ResourceNotFound.TagsNotFound The specified tag is not found.
    ResourcesSoldOut Resources have been sold out.
    ResourcesSoldOut.CbsSoldOut CBS resources have been sold out.
    ResourcesSoldOut.CvmSoldOut CVMs have been sold out.
    UnknownParameter Unknown parameter error.
    UnsupportedOperation The operation is not supported.

    ヘルプとサポート

    この記事はお役に立ちましたか?

    フィードバック