全部產品
Search
文件中心

:ALIYUN::POLARDB::DBClusterEndpoint

更新時間:Jun 19, 2024

ALIYUN::POLARDB::DBClusterEndpoint類型用於建立PolarDB自訂叢集地址。

文法

{
  "Type": "ALIYUN::POLARDB::DBClusterEndpoint",
  "Properties": {
    "DBClusterId": String,
    "ReadWriteMode": String,
    "EndpointType": String,
    "AutoAddNewNodes": String,
    "Nodes": List,
    "EndpointConfig": Map
  }
}

屬性

屬性名稱

類型

必須

允許更新

描述

約束

DBClusterId

String

叢集ID。

ReadWriteMode

String

讀寫入模式。

取值:

  • ReadWrite:可讀可寫,自動讀寫分離。

  • ReadOnly(預設值):唯讀。

EndpointType

String

自訂叢集地址類型。

取值:Custom。

AutoAddNewNodes

String

新節點是否自動加入自訂叢集地址。

取值:

  • Enable

  • Disable(預設值)

Nodes

List

用於處理讀請求的節點。

樣本值:["pi-bpsg35x****", "pi-bp3ddh****"]

取值至少包含兩個節點。預設值為全部節點。

EndpointConfig

Map

一致性層級。

更多資訊,請參見EndpointConfig屬性

EndpointConfig文法

"EndpointConfig": {
  "ConsistLevel": String,
  "ConsistTimeout": String,
  "LoadBalancePolicy": String,
  "ConnectionPersist": String,
  "DistributedTransaction": String,
  "EnableOverloadThrottle": String,
  "MasterAcceptReads": String,
  "ConsistTimeoutAction": String,
  "EnableHtapImci": String,
  "MaxParallelDegree": String
}  

EndpointConfig屬性

屬性名稱

類型

必須

允許更新

描述

約束

ConsistLevel

String

一致性層級。

取值:

  • 0:最終一致性

    說明

    如果參數ReadWriteMode取值為ReadOnly,一致性層級取值只能為0。

  • 1(預設值):會話一致性

ConsistTimeout

String

全域一致性讀逾時。

LoadBalancePolicy

String

設定負載平衡策略。

格式為{"LoadBalancePolicy":"負載平衡策略"}。

取值:

  • 0:基於串連數負載平衡(預設)。

  • 1:基於活躍請求數負載平衡。

ConnectionPersist

String

設定串連池。

格式為{"ConsistLevel":"串連池"}。

取值:

  • off:關閉串連池(預設值)。

  • Session:開啟會話級串連池。

  • Transaction:開啟事務級串連池。

DistributedTransaction

String

設定事務拆分。

格式為{"DistributedTransaction":"事務拆分"}。

取值:

  • on:開啟事務拆分(預設值)。

  • off:關閉事務拆分。

EnableOverloadThrottle

String

設定是否開啟過載保護。

格式為{"EnableOverloadThrottle":"是否開啟過載保護"}。

取值:

  • on:開啟過載保護。

  • off:關閉過載保護(預設)。

MasterAcceptReads

String

設定主庫是否接受讀。

格式為{"MasterAcceptReads":"主庫不接受讀"}。

取值:

  • on:表示主庫接受讀。

  • off:表示主庫不接受讀(預設值)。

ConsistTimeoutAction

String

全域一致性讀逾時策略。

取值:

  • 0:此請求發生在主節點(預設)。

  • 1:Sql錯誤報表。

EnableHtapImci

String

設定行存/列存自動引流。

格式為{"EnableHtapImci":"行存/列存自動引流"}。

取值:

  • on:開啟行存/列存自動引流功能。

  • off:關閉行存/列存自動引流功能(預設)。

MaxParallelDegree

String

設定並行查詢。

格式為{"MaxParallelDegree":"並行查詢"}。

取值:

  • on:開啟並行查詢。

  • off:關閉並行查詢(預設)。

傳回值

Fn::GetAtt

  • DBEndpointId:叢集地址ID。

  • ConnectionString:串連串。

  • Addresses:IP地址。

樣本

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  DBClusterEndpoint:
    Type: ALIYUN::POLARDB::DBClusterEndpoint
    Properties:
      DBClusterId:
        Ref: DBClusterId
      ReadWriteMode:
        Ref: ReadWriteMode
      EndpointConfig:
        Ref: EndpointConfig
      AutoAddNewNodes:
        Ref: AutoAddNewNodes
      Nodes:
        Fn::Split:
        - ","
        - Ref: Nodes
      EndpointType:
        Ref: EndpointType
Parameters:
  DBClusterId:
    Type: String
    Description: The ID of the ApsaraDB for POLARDB cluster for which a custom connection
      point is to be created.
  ReadWriteMode:
    Default: ReadOnly
    Type: String
    Description: 'The read/write mode of the cluster connection point. Valid values:ReadWrite:
      receives and forwards read and write requests (automatic read-write splitting).ReadOnly:
      receives and forwards only read requests.Default value: ReadOnly.'
    AllowedValues:
    - ReadOnly
    - ReadWrite
  EndpointConfig:
    Type: Json
    Description: ''
  AutoAddNewNodes:
    Default: Disable
    Type: String
    Description: |-
      Specifies whether a newly added node is automatically added to this connection point.
      Valid values: Enable, Disable.
      Default value: Disable.
    AllowedValues:
    - Disable
    - Enable
  Nodes:
    MinLength: 2
    Type: CommaDelimitedList
    Description: |-
      The nodes to be added to this connection point to process read requests from this connection point. Add at least two nodes.
      If you do not specify this parameter, all nodes of the cluster are added to this connection point by default.
  EndpointType:
    Default: Custom
    Type: String
    Description: The type of the cluster connection point. Set this parameter to Custom.
Outputs:
  DBEndpointId:
    Description: DB cluster endpoint ID. E.g. pe-xxxxxxxx.
    Value:
      Fn::GetAtt:
      - DBClusterEndpoint
      - DBEndpointId
  ConnectionString:
    Description: The first connection string of the db cluster endpoint.
    Value:
      Fn::GetAtt:
      - DBClusterEndpoint
      - ConnectionString
  Addresses:
    Description: The address items of the db cluster endpoint.
    Value:
      Fn::GetAtt:
      - DBClusterEndpoint
      - Addresses

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "DBClusterEndpoint": {
      "Type": "ALIYUN::POLARDB::DBClusterEndpoint",
      "Properties": {
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "ReadWriteMode": {
          "Ref": "ReadWriteMode"
        },
        "EndpointConfig": {
          "Ref": "EndpointConfig"
        },
        "AutoAddNewNodes": {
          "Ref": "AutoAddNewNodes"
        },
        "Nodes": {
          "Fn::Split": [
            ",",
            {
              "Ref": "Nodes"
            }
          ]
        },
        "EndpointType": {
          "Ref": "EndpointType"
        }
      }
    }
  },
  "Parameters": {
    "DBClusterId": {
      "Type": "String",
      "Description": "The ID of the ApsaraDB for POLARDB cluster for which a custom connection point is to be created."
    },
    "ReadWriteMode": {
      "Default": "ReadOnly",
      "Type": "String",
      "Description": "The read/write mode of the cluster connection point. Valid values: ReadWrite: receives and forwards read and write requests (automatic read-write splitting). ReadOnly: receives and forwards only read requests. Default value: ReadOnly.",
      "AllowedValues": [
        "ReadOnly",
        "ReadWrite"
      ]
    },
    "EndpointConfig": {
      "Type": "Json",
      "Description": ""
    },
    "AutoAddNewNodes": {
      "Default": "Disable",
      "Type": "String",
      "Description": "Specifies whether a newly added node is automatically added to this connection point.\nValid values: Enable, Disable.\nDefault value: Disable.",
      "AllowedValues": [
        "Disable",
        "Enable"
      ]
    },
    "Nodes": {
      "MinLength": 2,
      "Type": "CommaDelimitedList",
      "Description": "The nodes to be added to this connection point to process read requests from this connection point. Add at least two nodes.\nIf you do not specify this parameter, all nodes of the cluster are added to this connection point by default."
    },
    "EndpointType": {
      "Default": "Custom",
      "Type": "String",
      "Description": "The type of the cluster connection point. Set this parameter to Custom."
    }
  },
  "Outputs": {
    "DBEndpointId": {
      "Description": "DB cluster endpoint ID. E.g. pe-xxxxxxxx.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpoint",
          "DBEndpointId"
        ]
      }
    },
    "ConnectionString": {
      "Description": "The first connection string of the db cluster endpoint.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpoint",
          "ConnectionString"
        ]
      }
    },
    "Addresses": {
      "Description": "The address items of the db cluster endpoint.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpoint",
          "Addresses"
        ]
      }
    }
  }
}