文档

资源编排ROS集成示例

更新时间:

本文为您介绍RAM用户如何使用资源编排(ROS)创建云数据库 HBase 版(ApsaraDB for Hbase)实例。

前提条件

使用资源编排需要RAM用户权限,需要您创建一个RAM用户,并为其添加以下权限。

  • 具备管理资源编排服务所有操作的权限AliyunROSFullAccess

  • 具备管理云数据库 HBase 版所有操作的权限AliyunHBaseFullAccess

    说明

    为了便于演示,本示例使用AliyunHBaseFullAccess权限策略(具有查询、修改HBase实例的完全控制权限),您也可以按需选择AliyunHBaseReadOnlyAccess权限或进行自定义策略,更多信息请参见自定义RAM授权策略

操作步骤

  1. 登录资源编排ROS控制台,单击顶部导航栏地域下拉框,选择您需要的地域。

  2. 单击左侧菜单栏中的资源栈,选择创建资源栈 > 使用ROS

    • 指定模板:选中选择已有模板

    • 模板录入方式:选中输入模板

  3. 模板内容选择ROS,输入模板代码。

    说明

    本示例模板创建的HBase增强版实例规格:存储介质为SSD云盘,单节点磁盘容量为400 GB,Master规格为4核8 GB,Core规格为8核16 GB,Core节点数量为2。您可以根据业务需求修改模板参数值或添加其他参数,参数说明请参见ALIYUN::HBase::Cluster

    YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      VpcId:
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
        Required: false
        Type: String
        Label: 专有网络
        Description:
          en: |-
            The ID of the virtual private cloud (VPC). If you leave this parameter and the VSwitchId
            parameter empty, the classic network type is used. The VPC network type is preferred.
      VSwitchId:
        AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
          ZoneId: ${ZoneId}
        Required: false
        Type: String
        Label: 虚拟交换机
        Description:
          en: The ID of the vSwitch.
      PayType:
        Default: Postpaid
        Required: true
        Type: String
        Label: 付费类型
        Description:
          en: |-
            The billing method.
            Prepaid: The subscription billing method is used.
            Postpaid: The pay-as-you-go billing method is used.
        AllowedValues:
          - Prepaid
          - Postpaid
      ZoneId:
        AssociationProperty: ZoneId
        Required: true
        Type: String
        Label: 可用区
        Description:
          en: The ID of the zone.
    Resources:
      Cluster:
        Type: ALIYUN::HBase::Cluster
        Properties:
          Engine: hbaseue
          VpcId:
            Ref: VpcId
          CoreInstanceType: hbase.sn1.2xlarge
          PayType:
            Ref: PayType
          ZoneId:
            Ref: ZoneId
          MasterInstanceType: hbase.sn1.large
          VSwitchId:
            Ref: VSwitchId
          EngineVersion: '2.0'
          NodeCount: 2
          DiskSize: 400
          DiskType: cloud_ssd
    Outputs:
      ServiceConnAddrs:
        Description: LIST of ServiceConnAddr.
        Value:
          Fn::GetAtt:
            - Cluster
            - ServiceConnAddrs
      UiProxyConnAddrInfo:
        Description: WebUI connection information list.
        Value:
          Fn::GetAtt:
            - Cluster
            - UiProxyConnAddrInfo
      ThriftConn:
        Description: Thrift Connection address list.
        Value:
          Fn::GetAtt:
            - Cluster
            - ThriftConn
      SlbConnAddrs:
        Description: LIST of SlbConnAddr.
        Value:
          Fn::GetAtt:
            - Cluster
            - SlbConnAddrs
      ClusterId:
        Description: The ID of the instance.
        Value:
          Fn::GetAtt:
            - Cluster
            - ClusterId
      ZkConnAddrs:
        Description: List of ZkConnAddr.
        Value:
          Fn::GetAtt:
            - Cluster
            - ZkConnAddrs

    JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ZoneId": {
          "AssociationProperty": "ZoneId",
          "Type": "String",
          "Label": {
            "zh-cn": "可用区",
            "en": "Zone ID"
          },
          "Description": {
            "en": "The ID of the zone."
          },
          "Required": true
        },
        "VpcId": {
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
          "Type": "String",
          "Label": {
            "zh-cn": "专有网络",
            "en": "VPC ID"
          },
          "Description": {
            "en": "The ID of the virtual private cloud (VPC). If you leave this parameter and the VSwitchId\nparameter empty, the classic network type is used. The VPC network type is preferred."
          },
          "Required": false
        },
        "VSwitchId": {
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}",
            "ZoneId": "${ZoneId}"
          },
          "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
          "Type": "String",
          "Label": {
            "zh-cn": "虚拟交换机",
            "en": "VSwitch ID"
          },
          "Description": {
            "en": "The ID of the vSwitch."
          },
          "Required": false
        },
        "PayType": {
          "Type": "String",
          "Label": {
            "zh-cn": "付费模式",
            "en": "PayType"
          },
          "Description": {
            "en": "The billing method.\nPrepaid: The subscription billing method is used.\nPostpaid: The pay-as-you-go billing method is used."
          },
          "AllowedValues": [
            "Prepaid",
            "Postpaid"
          ],
          "Required": true,
          "Default": "Postpaid"
        }
      },
      "Resources": {
        "Cluster": {
          "Type": "ALIYUN::HBase::Cluster",
          "Properties": {
            "EngineVersion": "2.0",
            "NodeCount": 2,
            "ZoneId": {
              "Ref": "ZoneId"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            },
            "PayType": {
              "Ref": "PayType"
            },
            "MasterInstanceType": "hbase.sn1.large",
            "DiskType": "cloud_ssd",
            "VpcId": {
              "Ref": "VpcId"
            },
            "CoreInstanceType": "hbase.sn1.2xlarge",
            "Engine": "hbaseue",
            "DiskSize": 400
          }
        }
      },
      "Outputs": {
        "UiProxyConnAddrInfo": {
          "Description": "WebUI connection information list.",
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "UiProxyConnAddrInfo"
            ]
          }
        },
        "ClusterId": {
          "Description": "The ID of the instance.",
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "ClusterId"
            ]
          }
        },
        "ServiceConnAddrs": {
          "Description": "LIST of ServiceConnAddr.",
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "ServiceConnAddrs"
            ]
          }
        },
        "ThriftConn": {
          "Description": "Thrift Connection address list.",
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "ThriftConn"
            ]
          }
        },
        "SlbConnAddrs": {
          "Description": "LIST of SlbConnAddr.",
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "SlbConnAddrs"
            ]
          }
        },
        "ZkConnAddrs": {
          "Description": "List of ZkConnAddr.",
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "ZkConnAddrs"
            ]
          }
        }
      }
    }
  4. 单击下一步

  5. 创建资源栈页面,修改资源栈名称,并配置以下模板参数:

    参数

    说明

    专有网络

    选择HBase实例所属的专有网络VPC。

    虚拟交换机

    选择HBase实例所属的交换机。

    付费类型

    选择实例付费类型,取值如下:

    • Prepaid:包年包月(预付费)。

    • Postpaid:按量付费(后付费)。

    可用区

    选择HBase实例所属的可用区。

    说明

    此处仅提供了本示例的必填参数,其他HBase相关参数说明,请参见属性。更多创建资源栈的参数说明,请参见使用ROS模板创建资源栈

  6. 单击创建状态显示创建成功代表资源栈已创建完成。image

  7. 单击输出页签,查看HBase实例信息。返回值详细说明,请参见返回值

    1. 登录HBase管理控制台
    2. 在顶部菜单栏的左上角,选择实例所属的地域。
    3. 集群列表页搜索目标实例,单击实例ID可查看实例信息。