建立 Aurora Serverless v1 資料庫叢集 - Amazon Aurora

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

建立 Aurora Serverless v1 資料庫叢集

下列程序建立一個 Aurora Serverless v1 叢集,不包含任何結構描述物件或資料。若您要建立 Aurora Serverless v1 叢集,該叢集為現有佈建或 Aurora Serverless v1 叢集,您可改為執行快照還原或複製作業。如需這些詳細資訊,請參閱 從資料庫叢集快照還原複製 Amazon Aurora 資料庫叢集的一個磁碟區。您無法將現有的佈建叢集轉換為 Aurora Serverless v1。您也無法將現有的 Aurora Serverless v1 叢集轉換回佈建叢集。

當您建立 Aurora Serverless v1 資料庫叢集時,您可設定叢集的最小與最大容量。每個容量單位相等於一個特定的運算和記憶體組態。Aurora Serverless v1 會建立 CPU 使用率、連線和可用記憶體閾值的擴展規則,並根據您應用程式的需求,順暢地擴展到某個容量單位範圍。如需詳細資訊,請參閱 Aurora Serverless v1 架構

您可以為您的 Aurora Serverless v1 資料庫叢集設定以下特定值:

  • Minimum Aurora capacity unit (最小 Aurora 容量單位) – Aurora Serverless v1 可將容量降低至此容量單位下限。

  • Maximum Aurora capacity unit (最大 Aurora 容量單位) – Aurora Serverless v1 可將容量提升至此容量單位上限。

您也可以選擇下列選用的擴展組態選項:

  • 達到逾時時,強制將容量調擴展為指定的值 – 如果您希望 Aurora Serverless v1 強制 Aurora Serverless v1 擴展規模 (即使在逾時之前找不到擴展點),則可選擇此設定。如果您希望 Aurora Serverless v1 在找不到擴展點時取消容量變更,請勿選擇此設定。如需更多詳細資訊,請參閱 容量變更時的逾時動作

  • 在非使用狀態下連續數分鐘後暫停運算容量 – 如果您希望在指定的時間內資料庫叢集沒有任何活動時,Aurora Serverless v1 縮減為零,可以選擇此設定。啟用此設定後,Aurora Serverless v1 資料庫叢集會自動繼續處理,並在資料庫流量恢復時擴展至必要的容量以處理工作負載。如需進一步了解,請參閱Aurora Serverless v1 的暫停和繼續

在您可以建立Aurora Serverless v1資料庫叢集之前,您需要一個 AWS 帳戶。您也必須完成設定工作,才能使用 Amazon Aurora。如需更多詳細資訊,請參閱 設定您的 Amazon Aurora 環境。您還需要完成其他初步步驟以建立任何 Aurora 資料庫叢集。如需進一步了解,請參閱建立 Amazon Aurora 資料庫叢集

Aurora Serverless v1僅在特定的 Aurora MySQL AWS 區域 和 Aurora 版本中 PostgreSQL 定版本。如需詳細資訊,請參閱 Aurora Serverlessv1 支援的區域和 Aurora 資料庫引擎

注意

Aurora Serverless v1 叢集的叢集磁碟區一律會加密。建立 Aurora Serverless v1 資料庫叢集時,您就無法關閉加密,但您可以選擇使用自己的加密金鑰。利用 Aurora Serverless v2,您可選擇是否加密叢集磁碟區。

您可以使用 AWS Management Console、或 RDS API 建立Aurora Serverless v1資料庫叢集。 AWS CLI

注意

如果您在嘗試建立叢集時收到下列錯誤訊息,表示您的帳戶需要額外的權限。

Unable to create the resource. Verify that you have permission to create service linked role. Otherwise wait and try again later.

如需詳細資訊,請參閱「使用 Amazon Aurora 的服務連結角色」。

您無法直接連線到 Aurora Serverless v1 資料庫叢集上的資料庫執行個體。若要連線到 Aurora Serverless v1 資料庫叢集,您可以使用資料庫端點。您可以在 Aurora Serverless v1 中叢集的 Connectivity & security (連線與安全性) 索引標籤上找到 AWS Management Console資料庫叢集的端點。如需詳細資訊,請參閱 連接至 Amazon Aurora 資料庫叢集

使用下列一般程序。如需使用建立 Aurora 資料庫叢集的詳細資訊 AWS Management Console,請參閱建立 Amazon Aurora 資料庫叢集

如要建立新的 Aurora Serverless v1 資料庫叢集
  1. 登入 AWS Management Console。

  2. 選擇一 AWS 區域 個支持Aurora Serverless v1。

  3. 從「 AWS 服務」清單中選擇 Amazon RDS。

  4. 選擇建立資料庫

  5. Create database (建立資料庫) 頁面上:

    1. 選擇 Standard Create (標準建立) 做為資料庫建立方法。

    2. 請使用下列範例中的步驟,繼續建立 Aurora Serverless v1 資料庫叢集。

      注意

      如果您選擇的資料庫引擎版本不支援 Aurora Serverless v1,資料庫執行個體類別就不會顯示無伺服器選項。

Aurora MySQL 的範例

使用下列程序。

如要建立 Aurora MySQL 的 Aurora Serverless v1 資料庫叢集
  1. 針對引擎類型,請選擇 Aurora (MySQL 相容)

  2. 為您的資料庫叢集選擇您想要的 Aurora Serverless v1 相容 Aurora MySQL 版本。受支援的版本會顯示於頁面右側。

    使用主控台建立 Aurora Serverless v1 資料庫叢集
  3. 選擇無伺服器資料庫執行個體類別

  4. 設定資料庫叢集的 Capacity range (容量範圍)。

  5. 視需要,在頁面的 Additional scaling configuration (其他擴展組態) 區段中調整值。要進一步了解容量設定,請參閱 Aurora Serverless v1 的自動調整規模

    使用主控台為 Aurora MySQL Serverless v1 資料庫叢集設定容量
  6. 如要啟用 Aurora Serverless v1 資料庫叢集的資料 API,請選取 Connectivity (連線) 區段中 Additional configuration (其他組態) 下的 Data API (資料 API) 核取方塊。

    若要進一步了解資料 API,請參閱使用 RDS 資料 API

  7. 視需要選擇其他資料庫設定,然後選擇 Create database (建立資料庫)。

Aurora PostgreSQL 的範例

使用下列程序。

如要建立 Aurora PostgreSQL 的 Aurora Serverless v1 資料庫叢集
  1. 針對引擎類型,請選擇 Aurora (PostgreSQL 相容)

  2. 為您的資料庫叢集選擇您想要的 Aurora Serverless v1 相容 Aurora PostgreSQL 版本。受支援的版本會顯示於頁面右側。

    使用主控台建立 Aurora PostgreSQL Serverless v1 資料庫叢集
  3. 選擇無伺服器資料庫執行個體類別

  4. 若您選擇 Aurora PostgreSQL 第 13 版次要版本,請從選單中選擇 Serverless v1

    注意

    Aurora PostgreSQL 第 13 版也支援 Aurora Serverless v2。

  5. 設定資料庫叢集的 Capacity range (容量範圍)。

  6. 視需要,在頁面的 Additional scaling configuration (其他擴展組態) 區段中調整值。要進一步了解容量設定,請參閱 Aurora Serverless v1 的自動調整規模

    使用主控台為 Aurora PostgreSQL Serverless v1 資料庫叢集設定容量
  7. 如要使用 Aurora Serverless v1 資料庫叢集的資料 API,請選取連線區段中其他組態下的資料 API 核取方塊。

    若要進一步了解資料 API,請參閱使用 RDS 資料 API

  8. 視需要選擇其他資料庫設定,然後選擇 Create database (建立資料庫)。

若要使用建立新的Aurora Serverless v1資料庫叢集 AWS CLI,請執行create-db-cluster命令並serverless--engine-mode選項指定。

您可以選擇指定 --scaling-configuration 選項以設定最小容量、最大容量,並在沒有連線時自動暫停。

以下命令範例會透過將 --engine-mode 選項設為 serverless 來建立新的 Serverless 資料庫叢集。範例也會指定 --scaling-configuration 選項的值。

Aurora MySQL 的範例

以下命令會建立新的 Aurora MySQL 相容 Serverless 資料庫叢集。Aurora MySQL 的有效容量值為 1248163264128256

對於LinuxmacOS、或Unix:

aws rds create-db-cluster --db-cluster-identifier sample-cluster \ --engine aurora-mysql --engine-version 5.7.mysql_aurora.2.11.4 \ --engine-mode serverless \ --scaling-configuration MinCapacity=4,MaxCapacity=32,SecondsUntilAutoPause=1000,AutoPause=true \ --master-username username --master-user-password password

在 Windows 中:

aws rds create-db-cluster --db-cluster-identifier sample-cluster ^ --engine aurora-mysql --engine-version 5.7.mysql_aurora.2.11.4 ^ --engine-mode serverless ^ --scaling-configuration MinCapacity=4,MaxCapacity=32,SecondsUntilAutoPause=1000,AutoPause=true ^ --master-username username --master-user-password password

Aurora PostgreSQL 的範例

以下命令會建立新的 PostgreSQL 13.9 相容 Serverless 資料庫叢集。Aurora PostgreSQL 的有效容量值為 248163264192384

對於LinuxmacOS、或Unix:

aws rds create-db-cluster --db-cluster-identifier sample-cluster \ --engine aurora-postgresql --engine-version 13.9 \ --engine-mode serverless \ --scaling-configuration MinCapacity=8,MaxCapacity=64,SecondsUntilAutoPause=1000,AutoPause=true \ --master-username username --master-user-password password

在 Windows 中:

aws rds create-db-cluster --db-cluster-identifier sample-cluster ^ --engine aurora-postgresql --engine-version 13.9 ^ --engine-mode serverless ^ --scaling-configuration MinCapacity=8,MaxCapacity=64,SecondsUntilAutoPause=1000,AutoPause=true ^ --master-username username --master-user-password password

若要使用 RDS API 建立新的 Aurora Serverless v1 資料庫叢集,請執行 CreateDBCluster 操作並為 serverless 參數指定 EngineMode

您可選擇指定 ScalingConfiguration 參數以設定最小容量、最大容量,並在沒有連線時自動暫停。有效容量值包括:

  • Aurora MySQL:1248163264128256

  • Aurora PostgreSQL:248163264192384