ROS integration example

更新时间:
复制 MD 格式

This topic describes how a Resource Access Management (RAM) user can create an ApsaraDB for Hbase instance using Resource Orchestration Service (ROS).

Prerequisites

To use Resource Orchestration Service, you must create a RAM user and grant the user the following permissions.

  • The AliyunROSFullAccess permission to manage all operations in Resource Orchestration Service.

  • The AliyunHBaseFullAccess permission to manage all operations in ApsaraDB for Hbase.

    Note

    For demonstration purposes, this example uses the AliyunHBaseFullAccess access policy. This policy grants full control to query and modify HBase instances. Alternatively, you can use the AliyunHBaseReadOnlyAccess permission or create a custom policy as needed. For more information, see Custom RAM authorization policies.

Procedure

  1. Log on to the Resource Orchestration Service (ROS) console. In the top navigation bar, select a region, such as China (Shanghai).

  2. In the navigation pane on the left, click Stacks, and then choose Create Stack > Use ROS.

    • Set Specify Template to Select Existing Template.

    • Set Template Import Method to Enter Template.

  3. For Template Body, select ROS and enter the template code.

    Note

    The template in this example creates an ApsaraDB for HBase Enhanced Edition instance. The instance uses standard SSDs for storage, with a disk capacity of 400 GB per node. The Master instance type is 4-core 8 GB, and the core instance type is 8-core 16 GB. The cluster has two core nodes. You can modify the template parameter values or add other parameters as needed. For more information about the parameters, see ALIYUN::HBase::Cluster.

    YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      VpcId:
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
        Required: false
        Type: String
        Label: VPC
        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: vSwitch
        Description:
          en: The ID of the vSwitch.
      PayType:
        Default: Postpaid
        Required: true
        Type: String
        Label: Billing Method
        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: Zone
        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 format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ZoneId": {
          "AssociationProperty": "ZoneId",
          "Type": "String",
          "Label": "Zone ID",
          "Description": "The ID of the zone.",
          "Required": true
        },
        "VpcId": {
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
          "Type": "String",
          "Label": "VPC ID",
          "Description": "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": "VSwitch ID",
          "Description": "The ID of the vSwitch.",
          "Required": false
        },
        "PayType": {
          "Type": "String",
          "Label": "PayType",
          "Description": "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. Click Next.

  5. On the Create Stack page, set the Stack Name and configure the following template parameters:

    Parameter

    Description

    VPC

    Select the virtual private cloud (VPC) for the HBase instance.

    vSwitch

    Select the vSwitch for the HBase instance.

    Billing Method

    Select the billing method for the instance. Valid values:

    • Prepaid: subscription.

    • Postpaid: pay-as-you-go.

    Zone

    Select the zone for the HBase instance.

    Note

    This section describes only the required parameters for this example. For more information about other HBase parameters, see Properties. For more information about the parameters for creating a stack, see Create a stack using an existing template.

  6. Click Create. The stack is successfully created when its Status changes to Create Succeeded.

  7. Click the Outputs tab to view the HBase instance information. For more information about the return values, see Return values.

    1. Log on to the ApsaraDB for HBase console.
    2. In the top navigation bar, select the region where the cluster that you want to manage is deployed.
    3. On the Clusters page, find the target instance and click the instance ID to view the instance information.