ALIYUN::ClickHouse::SynDb

Updated at:

ALIYUN::ClickHouse::SynDb类型用于创建云数据库ClickHouse社区兼容版同步任务。

语法

{
  "Type": "ALIYUN::ClickHouse::SynDb",
  "Properties": {
    "RdsVpcUrl": String,
    "LimitUpper": Integer,
    "SkipUnsupported": Boolean,
    "RdsId": String,
    "RdsPassword": String,
    "RdsUserName": String,
    "CkPassword": String,
    "CkUserName": String,
    "ClickhousePort": Integer,
    "SynDbTables": List,
    "DbClusterId": String,
    "RdsPort": Integer,
    "RdsVpcId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

CkPassword

String

是

否

云数据库ClickHouse的数据库账号密码。

无

CkUserName

String

是

否

云数据库ClickHouse的数据库账号。

无

DbClusterId

String

是

否

云数据库ClickHouse的集群ID。

无

RdsId

String

是

否

云数据库RDS MySQL的实例ID。

无

RdsPassword

String

是

否

云数据库RDS MySQL的数据库账号密码。

无

RdsUserName

String

是

否

云数据库RDS MySQL的数据库账号。

无

SkipUnsupported

Boolean

是

否

是否忽略不支持同步的表结构。

取值:

  • true:忽略。

  • false:不忽略。

SynDbTables

List

是

否

同步的表。

更多信息,请参见SynDbTables属性。

ClickhousePort

Integer

否

否

云数据库ClickHouse的端口号。

无

LimitUpper

Integer

否

否

每秒最多同步的行数。

无

RdsPort

Integer

否

否

云数据库RDS MySQL的端口号。

无

RdsVpcId

String

否

否

云数据库RDS MySQL的VPC ID。

无

RdsVpcUrl

String

否

否

云数据库RDS的内网地址。

无

SynDbTables语法

"SynDbTables": [
  {
    "Schema": String,
    "Tables": List
  }
]

SynDbTables属性

属性名称

类型

必须

允许更新

描述

约束

Schema

String

是

否

数据库名。

无

Tables

List

是

否

表信息。

无

返回值

Fn::GetAtt

  • SynDbs:同步数据。

  • DbClusterId:云数据库ClickHouse的集群ID。

  • RdsId:云数据库RDS MySQL的实例ID。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  CkPassword:
    Description: The password of the database account
    Type: String
  CkUserName:
    Description: The account of the clickhouse database.
    Type: String
  ClickhousePort:
    Description: The port of clickhouse id.
    Type: Number
  DbClusterId:
    Description: Clickhouse cluster id.
    Type: String
  LimitUpper:
    Description: The maximum number of rows to sync per second.
    Type: Number
  RdsId:
    Description: The instance id of RDS.
    Type: String
  RdsPassword:
    Description: The password of the RDS database account.
    Type: String
  RdsPort:
    Description: The port of rds.
    Type: Number
  RdsUserName:
    Description: The account of the RDS database.
    Type: String
  RdsVpcId:
    Description: The vpc of rds.
    Type: String
  RdsVpcUrl:
    Description: Intranet address of ApsaraDB for RDS.
    Type: String
  SkipUnsupported:
    Description: Skip unsupported table or not.
    Type: Boolean
  SynDbTables:
    Description: The tables to syn.
    MaxLength: 10
    Type: Json
Resources:
  SynDb:
    Properties:
      CkPassword:
        Ref: CkPassword
      CkUserName:
        Ref: CkUserName
      ClickhousePort:
        Ref: ClickhousePort
      DbClusterId:
        Ref: DbClusterId
      LimitUpper:
        Ref: LimitUpper
      RdsId:
        Ref: RdsId
      RdsPassword:
        Ref: RdsPassword
      RdsPort:
        Ref: RdsPort
      RdsUserName:
        Ref: RdsUserName
      RdsVpcId:
        Ref: RdsVpcId
      RdsVpcUrl:
        Ref: RdsVpcUrl
      SkipUnsupported:
        Ref: SkipUnsupported
      SynDbTables:
        Ref: SynDbTables
    Type: ALIYUN::ClickHouse::SynDb
Outputs:
  DbClusterId:
    Description: The id of clickhouse.
    Value:
      Fn::GetAtt:
      - SynDb
      - DbClusterId
  RdsId:
    Description: The id of RDS
    Value:
      Fn::GetAtt:
      - SynDb
      - RdsId
  SynDbs:
    Description: Sync Dbs
    Value:
      Fn::GetAtt:
      - SynDb
      - SynDbs

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RdsVpcUrl": {
      "Type": "String",
      "Description": "Intranet address of ApsaraDB for RDS."
    },
    "LimitUpper": {
      "Type": "Number",
      "Description": "The maximum number of rows to sync per second."
    },
    "SkipUnsupported": {
      "Type": "Boolean",
      "Description": "Skip unsupported table or not."
    },
    "RdsId": {
      "Type": "String",
      "Description": "The instance id of RDS."
    },
    "RdsPassword": {
      "Type": "String",
      "Description": "The password of the RDS database account."
    },
    "RdsUserName": {
      "Type": "String",
      "Description": "The account of the RDS database."
    },
    "CkPassword": {
      "Type": "String",
      "Description": "The password of the database account"
    },
    "CkUserName": {
      "Type": "String",
      "Description": "The account of the clickhouse database."
    },
    "ClickhousePort": {
      "Type": "Number",
      "Description": "The port of clickhouse id."
    },
    "SynDbTables": {
      "Type": "Json",
      "Description": "The tables to syn.",
      "MaxLength": 10
    },
    "DbClusterId": {
      "Type": "String",
      "Description": "Clickhouse cluster id."
    },
    "RdsPort": {
      "Type": "Number",
      "Description": "The port of rds."
    },
    "RdsVpcId": {
      "Type": "String",
      "Description": "The vpc of rds."
    }
  },
  "Resources": {
    "SynDb": {
      "Type": "ALIYUN::ClickHouse::SynDb",
      "Properties": {
        "RdsVpcUrl": {
          "Ref": "RdsVpcUrl"
        },
        "LimitUpper": {
          "Ref": "LimitUpper"
        },
        "SkipUnsupported": {
          "Ref": "SkipUnsupported"
        },
        "RdsId": {
          "Ref": "RdsId"
        },
        "RdsPassword": {
          "Ref": "RdsPassword"
        },
        "RdsUserName": {
          "Ref": "RdsUserName"
        },
        "CkPassword": {
          "Ref": "CkPassword"
        },
        "CkUserName": {
          "Ref": "CkUserName"
        },
        "ClickhousePort": {
          "Ref": "ClickhousePort"
        },
        "SynDbTables": {
          "Ref": "SynDbTables"
        },
        "DbClusterId": {
          "Ref": "DbClusterId"
        },
        "RdsPort": {
          "Ref": "RdsPort"
        },
        "RdsVpcId": {
          "Ref": "RdsVpcId"
        }
      }
    }
  },
  "Outputs": {
    "SynDbs": {
      "Description": "Sync Dbs",
      "Value": {
        "Fn::GetAtt": [
          "SynDb",
          "SynDbs"
        ]
      }
    },
    "DbClusterId": {
      "Description": "The id of clickhouse.",
      "Value": {
        "Fn::GetAtt": [
          "SynDb",
          "DbClusterId"
        ]
      }
    },
    "RdsId": {
      "Description": "The id of RDS",
      "Value": {
        "Fn::GetAtt": [
          "SynDb",
          "RdsId"
        ]
      }
    }
  }
}