文档

ALIYUN::EMR::Cluster2

更新时间:

ALIYUN::EMR::Cluster2类型用于创建EMR集群。

说明

ALIYUN::EMR::Cluster支持基于E-MapReduce产品的旧版API,支持旧版HADOOP、KAFKA 、DRUID 、ZOOKEEPER、DATA_SCIENCE、GATEWAY等早期的集群类型。ALIYUN::EMR::Cluster2支持基于E-MapReduce产品的新版API(2021-03-20),支持DATALAKE、OLAP、DATAFLOW、DATASERVING等新的集群类型,如果没有早期集群类型需求,建议使用ALIYUN::EMR::Cluster2资源创建EMR集群。

语法

{
  "Type": "ALIYUN::EMR::Cluster2",
  "Properties": {
    "Applications": List,
    "ResourceGroupId": String,
    "ApplicationConfigs": List,
    "ClusterType": String,
    "NodeGroups": List,
    "ReleaseVersion": String,
    "BootstrapScripts": List,
    "SubscriptionConfig": Map,
    "DeployMode": String,
    "SecurityMode": String,
    "NodeAttributes": Map,
    "ClusterName": String,
    "PaymentType": String,
    "Tags": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Applications

List

应用列表。

最多添加100个应用。

更多信息,请参见Applications属性

ResourceGroupId

String

资源组ID。

ApplicationConfigs

List

应用配置。

最多添加1000个应用配置。

更多信息,请参见ApplicationConfigs属性

ClusterType

String

集群类型。

取值:

  • DATALAKE:新版数据湖。

  • OLAP:数据分析。

  • DATAFLOW:实时数据流。

  • DATASERVING:数据服务。

NodeGroups

List

节点组配置数组。

最多添加100个节点组配置。

更多信息,请参见NodeGroups属性

ReleaseVersion

String

EMR发行版。

BootstrapScripts

List

引导脚本数组。

最多添加10个引导脚本数组。

更多信息,请参见BootstrapScripts属性

SubscriptionConfig

Map

预付费配置。

当PaymentType取值为Subscription时,本参数必填。

DeployMode

String

集群中的应用部署模式。

取值:

  • NORMAL:非高可用部署。集群1个MASTER节点。

  • HA:高可用部署。高可用部署要求至少3个MASTER节点。

SecurityMode

String

集群Kerberos安全模式。

取值:

  • NORMAL:普通模式,不开启Kerberos模式。

  • KERBEROS:开启Kerberos模式。

NodeAttributes

Map

节点属性。

集群所有ECS节点基础属性。

ClusterName

String

集群名称。

长度为1~128个字符,必须以大小写字母或中文开头,不能以http://https:// 开头。可以包含中文、英文、数字、半角冒号(:)、下划线(_)、半角句号(.)或者短划线(-)。

PaymentType

String

付费类型。

取值:

  • PayAsYouGo:后付费。

  • Subscription:预付费。

Tags

List

标签。

最多添加20个自定义标签。

更多信息,请参见Tags属性

Applications语法

"Applications": [
  {
    "ApplicationName": String
  }
]

Applications属性

属性名称

类型

必须

允许更新

描述

约束

ApplicationName

String

应用名称。

ApplicationConfigs语法

"ApplicationConfigs": [
  {
    "ConfigFileName": String,
    "ApplicationName": String,
    "ConfigItemKey": String,
    "NodeGroupName": String,
    "NodeGroupId": String,
    "ConfigScope": String,
    "ConfigItemValue": String
  }
]

ApplicationConfigs属性

属性名称

类型

必须

允许更新

描述

约束

ConfigFileName

String

配置文件名称。

ApplicationName

String

应用名称。

ConfigItemKey

String

配置项键。

NodeGroupName

String

节点组名称。

当ConfigScope取值为NODE_GROUP且NodeGroupId取值为空时,本参数生效。

NodeGroupId

String

节点组ID。

当ConfigScope取值为NODE_GROUP时,本参数生效。

说明

NodeGroupId参数的优先级高于NodeGroupName参数。

ConfigScope

String

配置范围。

取值:

  • CLUSTER(默认值):集群级别。

  • NODE_GROUP:节点组级别。

ConfigItemValue

String

配置项值。

NodeGroups语法

"NodeGroups": [
  {
    "WithPublicIp": Boolean,
    "SpotInstanceRemedy": Boolean,
    "NodeCount": Number,
    "NodeGroupName": String,
    "DataDisks": List,
    "VSwitchIds": List,
    "SpotBidPrices": List,
    "NodeResizeStrategy": String,
    "SystemDisk": Map,
    "NodeGroupType": String,
    "InstanceTypes": List,
    "AdditionalSecurityGroupIds": List,
    "CostOptimizedConfig": Map,
    "GracefulShutdown": Boolean,
    "DeploymentSetStrategy": String,
    "SpotStrategy": String
  }
]

NodeGroups属性

属性名称

类型

必须

允许更新

描述

约束

WithPublicIp

Boolean

是否开公网IP。

取值:

  • true:开公网IP。

  • false(默认值):不开公网IP。

SpotInstanceRemedy

Boolean

是否开启抢占式实例。当收到抢占式实例将被回收的系统消息时,伸缩组将尝试创建新的实例,替换掉将被回收的抢占式实例。

取值:

  • true:开启抢占式实例。

  • false(默认值):不开启抢占式实例。

NodeCount

Number

节点数量。

取值范围:1~1000。

NodeGroupName

String

节点组名称。

最大长度128个字符。集群内要求节点组名称唯一。

DataDisks

List

数据盘。

更多信息,请参见DataDisks属性

VSwitchIds

List

虚拟交换机ID列表。

SpotBidPrices

List

抢占式Spot实例出价价格。

当SpotStrategy取值为SpotWithPriceLimit时,本参数生效。

说明

最多添加100个实例出价价格。

更多信息,请参见SpotBidPrices属性

NodeResizeStrategy

String

节点扩容策略。

取值:

  • COST_OPTIMIZED:成本优化策略。

  • PRIORITY(默认值):优先级策略。

SystemDisk

Map

系统盘。

更多信息,请参见SystemDisk属性

NodeGroupType

String

节点组类型。

取值:

  • MASTER:管理类型节点组。

  • CORE:存储类型节点组。

  • TASK:计算类型节点组。

InstanceTypes

List

节点实例类型列表。

最多添加100个节点实例类型。

AdditionalSecurityGroupIds

List

附加安全组。

除集群设置的安全组外,为节点组单独设置的附加安全组,最多添加2个附加安全组。

CostOptimizedConfig

Map

成本优化模式配置。

GracefulShutdown

Boolean

节点组上部署的组件是否开启优雅下线。

取值:

  • true:开启优雅下线。

  • false(默认值):不开启优雅下线

DeploymentSetStrategy

String

部署集策略。

取值:

  • NONE(默认值):不适用部署集。

  • CLUSTER:使用集群级别部署集。

  • NODE_GROUP:使用节点组级别部署集。

SpotStrategy

String

抢占式Spot实例策略。

取值:

  • NoSpot(默认值):正常按量付费实例。

  • SpotWithPriceLimit:设置最高出价的抢占式实例。

  • SpotAsPriceGo:系统自动出价,最高按量付费价格的抢占式实例。

DataDisks语法

"DataDisks": [
  {
    "Category": String,
    "PerformanceLevel": String,
    "Size": Number,
    "Count": Number
  }
]

DataDisks属性

属性名称

类型

必须

允许更新

描述

约束

Category

String

磁盘类型。

PerformanceLevel

String

创建ESSD云盘作为数据盘使用时,设置云盘的性能等级。

取值:

  • PL0:单盘最高随机读写IOPS 1万。

  • PL1(默认值):单盘最高随机读写IOPS 5万。

  • PL2:单盘最高随机读写IOPS 10万。

  • PL3:单盘最高随机读写IOPS 100万。

Size

Number

磁盘大小。

Count

Number

每个节点系统盘数量。

SpotBidPrices语法

"SpotBidPrices": [
  {
    "BidPrice": Number,
    "InstanceType": String
  }
]

SpotBidPrices属性

属性名称

类型

必须

允许更新

描述

约束

BidPrice

Number

实例的每小时最高出价。

支持最大3位小数,当参数SpotStrategy取值为SpotWithPriceLimit时,本参数生效。

InstanceType

String

ECS实例类型。

SystemDisk语法

"SystemDisk": {
  "Category": String,
  "PerformanceLevel": String,
  "Size": Number,
  "Count": Number
}

SystemDisk属性

属性名称

类型

必须

允许更新

描述

约束

Category

String

磁盘类型。

PerformanceLevel

String

创建ESSD云盘作为系统盘使用时,设置云盘的性能等级。

取值:

  • PL0:单盘最高随机读写IOPS 1万。

  • PL1(默认):单盘最高随机读写IOPS 5万。

  • PL2:单盘最高随机读写IOPS 10万。

  • PL3:单盘最高随机读写IOPS 100万。

Size

Number

磁盘容量大小。

取值范围:20~500。

Count

Number

每个节点系统盘数量。

默认值:1。

CostOptimizedConfig语法

"CostOptimizedConfig": {
  "OnDemandBaseCapacity": Number,
  "OnDemandPercentageAboveBaseCapacity": Number,
  "SpotInstancePools": Number
}

CostOptimizedConfig属性

属性名称

类型

必须

允许更新

描述

约束

OnDemandBaseCapacity

Number

节点组所需按量计费实例个数的最小值。

OnDemandPercentageAboveBaseCapacity

Number

节点组满足最小按量计费实例数(OnDemandBaseCapacity)要求后,超出的实例中按量计费实例应占的比例。

取值范围:0~100。

SpotInstancePools

Number

指定可用实例规格的个数。

BootstrapScripts语法

"BootstrapScripts": [
  {
    "ScriptPath": String,
    "ScriptArgs": String,
    "ExecutionFailStrategy": String,
    "Priority": Number,
    "ScriptName": String,
    "ExecutionMoment": String,
    "NodeSelector": Map
  }
]

BootstrapScripts属性

属性名称

类型

必须

允许更新

描述

约束

ScriptPath

String

脚本所在OSS路径。

oss:// 开头。

ScriptArgs

String

脚本执行参数。

ExecutionFailStrategy

String

执行失败策略。

取值:

  • FAILED_CONTINUE:失败后不阻塞集群创建或者阻塞集群扩容。

  • FAILED_BLOCK:失败后阻塞集群创建或者阻塞集群扩容。

Priority

Number

脚本执行优先级。

取值范围:1~100。

ScriptName

String

脚本名称。

长度为1~64个字符,必须以大小写字母或中文开头,不能以 http:// https:// 开头。可以包含中文、英文、数字、下划线(_)、或者短划线(-)。

ExecutionMoment

String

脚本的执行时机。

取值:

  • BEFORE_INSTALL:应用安装前。

  • AFTER_STARTED:应用启动后。

NodeSelector

Map

节点选择器。

NodeSelector语法

"NodeSelector": {
  "NodeGroupTypes": List,
  "NodeGroupName": String,
  "NodeGroupId": String,
  "NodeSelectType": String,
  "NodeNames": List
}

NodeSelector属性

属性名称

类型

必须

允许更新

描述

约束

NodeGroupTypes

List

节点组类型。

取值:

  • MASTER:主节点组类型。

  • CORE:核心节点组类型。

  • TASK:计算阶节点组类型。

NodeGroupName

String

节点组名称。

当NodeSelectType取值为NodeGroup且NodeGroupId取值为空时,本参数生效。

NodeGroupId

String

节点组ID。

当NodeSelectType取值为NodeGroup时,本参数生效。

NodeSelectType

String

节点选择类型。

取值:

  • CLUSTER:集群。

  • NODE_GROUP:节点组。

  • NODE:节点。

NodeNames

List

节点名称列表。

当NodeSelectType取值Node时,本参数生效。

SubscriptionConfig语法

"SubscriptionConfig": {
  "AutoRenewDurationUnit": String,
  "AutoRenew": Boolean,
  "PaymentDurationUnit": String,
  "PaymentDuration": Number,
  "AutoRenewDuration": Number
}

SubscriptionConfig属性

属性名称

类型

必须

允许更新

描述

约束

AutoRenewDurationUnit

String

自动续费时长单位。

取值:

Month:月。

AutoRenew

Boolean

自动续费。

取值:

  • true:开启启动续费。

  • false(默认值):不开启自动续费。

PaymentDurationUnit

String

付费时长单位。

取值:

Month:月。

PaymentDuration

Number

付费时长。

当PaymentDurationUnit取值为Month时,取值为1、2、3、4、5、6、7、8、9、12、24、36、48、60。

AutoRenewDuration

Number

自动续费时长。

当AutoRenew取值为true时,本参数生效。当AutoRenewDurationUnit取值为Month时,取值为1、2、3、4、5、6、7、8、9、12、24、36、48、60。

NodeAttributes语法

"NodeAttributes": {
  "KeyPairName": String,
  "VpcId": String,
  "ZoneId": String,
  "SecurityGroupId": String,
  "RamRole": String,
  "MasterRootPassword": String
}

NodeAttributes属性

属性名称

类型

必须

允许更新

描述

约束

KeyPairName

String

ECS SSH登录密钥。

VpcId

String

专有网络ID。

ZoneId

String

可用区ID。

SecurityGroupId

String

安全组ID。

EMR只支持普通安全组,不支持企业安全组。

RamRole

String

ECS访问资源绑定的角色。

默认值:AliyunECSInstanceForEMRRole。

MasterRootPassword

String

主节点Root密码。

Tags语法

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Value

String

标签值。

非必填,可以为空字符串。最多支持128个字符,不能以acs:开头,不能包含http://或者https://

Key

String

标签键。

必填参数,不允许为空字符串。最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

返回值

Fn::GetAtt

  • ClusterId:集群ID。

  • ApplicationLinks:集群应用链接。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Applications:
    Type: Json
    Description: 'Application List.The value range of the number n of the number N group: 1 ~ 100.'
  ClusterType:
    Type: String
    Description: |-
      Cluster type.Ranges:
      Datalake: The new version of the data lake.
      OLAP: Data analysis.
      DataFlow: Real -time data stream.
      DataServing: Data service.
      Hadoop: The old version of the data lake (not recommended, it is recommended to use the new version of the data lake).
    AllowedValues:
      - DATAFLOW
      - DATALAKE
      - DATASERVING
      - HADOOP
      - OLAP
  NodeGroups:
    Type: Json
    Description: 'The node group configuration array.The value range of the number n of the number N group: 1 ~ 100.'
    MinLength: 1
    MaxLength: 100
  ReleaseVersion:
    Type: String
    Description: EMR release version.View EMR distribution versions can be viewed through the EMR cluster.
  NodeAttributes:
    Type: Json
    Description: Node attributes.All ECS nodes basic attributes of the cluster.
  ClusterName:
    Type: String
    Description: 'Cluster name.The length is 1 ~ 128 characters, and the alphabet or Chinese must be started. It cannot start with http:// and https: //.It can include Chinese, English, numbers, half-horn colons (:), down line (_), half-angle period (.) Or short lines (-)'
Resources:
  Cluster:
    Type: ALIYUN::EMR::Cluster2
    Properties:
      Applications:
        Ref: Applications
      ClusterType:
        Ref: ClusterType
      NodeGroups:
        Ref: NodeGroups
      ReleaseVersion:
        Ref: ReleaseVersion
      NodeAttributes:
        Ref: NodeAttributes
      ClusterName:
        Ref: ClusterName
Outputs:
  ClusterId:
    Description: Cluster ID.
    Value:
      Fn::GetAtt:
        - Cluster
        - ClusterId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Applications": {
      "Type": "Json",
      "Description": "Application List.The value range of the number n of the number N group: 1 ~ 100."
    },
    "ClusterType": {
      "Type": "String",
      "Description": "Cluster type.Ranges:\nDatalake: The new version of the data lake.\nOLAP: Data analysis.\nDataFlow: Real -time data stream.\nDataServing: Data service.\nHadoop: The old version of the data lake (not recommended, it is recommended to use the new version of the data lake).",
      "AllowedValues": [
        "DATAFLOW",
        "DATALAKE",
        "DATASERVING",
        "HADOOP",
        "OLAP"
      ]
    },
    "NodeGroups": {
      "Type": "Json",
      "Description": "The node group configuration array.The value range of the number n of the number N group: 1 ~ 100.",
      "MinLength": 1,
      "MaxLength": 100
    },
    "ReleaseVersion": {
      "Type": "String",
      "Description": "EMR release version.View EMR distribution versions can be viewed through the EMR cluster."
    },
    "NodeAttributes": {
      "Type": "Json",
      "Description": "Node attributes.All ECS nodes basic attributes of the cluster."
    },
    "ClusterName": {
      "Type": "String",
      "Description": "Cluster name.The length is 1 ~ 128 characters, and the alphabet or Chinese must be started. It cannot start with http:// and https: //.It can include Chinese, English, numbers, half-horn colons (:), down line (_), half-angle period (.) Or short lines (-)"
    }
  },
  "Resources": {
    "Cluster": {
      "Type": "ALIYUN::EMR::Cluster2",
      "Properties": {
        "Applications": {
          "Ref": "Applications"
        },
        "ClusterType": {
          "Ref": "ClusterType"
        },
        "NodeGroups": {
          "Ref": "NodeGroups"
        },
        "ReleaseVersion": {
          "Ref": "ReleaseVersion"
        },
        "NodeAttributes": {
          "Ref": "NodeAttributes"
        },
        "ClusterName": {
          "Ref": "ClusterName"
        }
      }
    }
  },
  "Outputs": {
    "ClusterId": {
      "Description": "Cluster ID.",
      "Value": {
        "Fn::GetAtt": [
          "Cluster",
          "ClusterId"
        ]
      }
    }
  }
}
  • 本页导读 (1)
文档反馈