還原 Aurora Serverless v1 資料庫叢集 - Amazon Aurora

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

還原 Aurora Serverless v1 資料庫叢集

當您透過 Aurora Serverless v1、AWS Management Console 或 RDS API 還原佈建的資料庫叢集快照時,您可設定 AWS CLI 資料庫叢集。

在您將快照還原至 Aurora Serverless v1 資料庫叢集時,您可以設定以下指定值:

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

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

  • Timeout action (逾時動作) – 當容量修改因找不到擴展點而逾時時,所要採取的動作。Aurora Serverless v1如果設定為 Force scaling the capacity to the specified values... (強制將容量擴展為指定的值...) 選項,則資料庫叢集可以強制將資料庫叢集設定為新的容量設定。或者,如果您沒有選擇此選項,它可以復原容量變更以取消容量變更。如需更多詳細資訊,請參閱 容量變更時的逾時動作

  • Pause after inactivity (在無動作後暫停) – 資料庫經過多久時間沒有流量後,將處理容量縮減為零。當資料庫流量恢復,Aurora 會自動恢復處理容量,並調整規模以應付流量。

如需從快照還原資料庫叢集的一般資訊,請參閱 從資料庫叢集快照還原

您可以使用 AWS Management Console 將資料庫叢集快照還原至 Aurora 資料庫叢集。

還原資料庫叢集快照至 Aurora 資料庫叢集
  1. 登入 AWS Management Console,開啟位於 https://console.aws.amazon.com/rds/ 的 Amazon RDS 主控台。

  2. 請在 AWS Management Console 的右上角選取裝載您來源資料庫叢集的 AWS 區域。

  3. 在導覽窗格中,選擇 Snapshots (快照),然後選擇您要還原的資料庫叢集快照。

  4. 針對 Actions (動作),選擇 Restore Snapshot (還原快照)。

  5. Restore DB Cluster (還原資料庫叢集) 頁面上的 Capacity type (容量類型),選擇 Serverless (無伺服器)

    使用主控台還原 Aurora Serverless v1 資料庫叢集。
  6. DB cluster identifier (資料庫叢集識別符) 欄位中,輸入您還原的資料庫叢集名稱,並填妥其他欄位。

  7. Capacity settings (容量設定) 區段中修改擴展組態。

    使用主控台設定 Aurora Serverless v1 資料庫叢集的容量下限與上限
  8. 選擇 Restore DB Cluster (還原資料庫叢集)。

若要連線至 Aurora Serverless v1 資料庫叢集,請使用資料庫端點。如需詳細資訊,請參閱 連接至 Amazon Aurora 資料庫叢集 中的說明。

注意

如果您遇到下列錯誤訊息,您的帳戶將要求額外許可:

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、AWS Management Console 或 RDS API 還原佈建的資料庫叢集快照時,您可設定 AWS CLI 資料庫叢集。

在您將快照還原至 Aurora Serverless 資料庫叢集時,您可以設定以下指定值:

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

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

  • Timeout action (逾時動作) – 當容量修改因找不到擴展點而逾時時,所要採取的動作。Aurora Serverless v1如果設定為 Force scaling the capacity to the specified values... (強制將容量擴展為指定的值...) 選項,則資料庫叢集可以強制將資料庫叢集設定為新的容量設定。或者,如果您沒有選擇此選項,它可以復原容量變更以取消容量變更。如需更多詳細資訊,請參閱 容量變更時的逾時動作

  • Pause after inactivity (在無動作後暫停) – 資料庫經過多久時間沒有流量後,將處理容量縮減為零。當資料庫流量恢復,Aurora 會自動恢復處理容量,並調整規模以應付流量。

注意

資料庫叢集快照的版本必須與 Aurora Serverless v1 相容。如需支援版本的清單,請參閱 Aurora Serverlessv1 支援的區域和 Aurora 資料庫引擎

若要將快照還原至與 MySQL 5.7 相容的 Aurora Serverless v1 叢集,請包含下列其他參數:

  • --engine aurora-mysql

  • --engine-version 5.7

--engine--engine-version 參數可讓您從與 MySQL 5.6 相容的 Aurora 或 Aurora Serverless v1 快照,建立與 MySQL 5.7 相容的 Aurora Serverless v1 叢集。以下範例會將快照從名為 mydbclustersnapshot 的 MySQL 5.6 相容叢集,還原至名為 mynewdbcluster 的 MySQL 5.7 相容 Aurora Serverless v1 叢集。

對於LinuxmacOS、或Unix:

aws rds restore-db-cluster-from-snapshot \ --db-cluster-identifier mynewdbcluster \ --snapshot-identifier mydbclustersnapshot \ --engine-mode serverless \ --engine aurora-mysql \ --engine-version 5.7

在Windows中:

aws rds restore-db-cluster-from-snapshot ^ --db-instance-identifier mynewdbcluster ^ --db-snapshot-identifier mydbclustersnapshot ^ --engine aurora-mysql ^ --engine-version 5.7

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

  • Aurora MySQL:1248163264128256

  • Aurora PostgreSQL:248163264192384

在以下範例中,您會從先前建立的資料庫叢集快照 (名為 mydbclustersnapshot) 還原至名為 mynewdbcluster 的新資料庫叢集。您可以設定 --scaling-configuration,以便新的 Aurora Serverless v1 資料庫叢集可視需要從 8 個 ACU 擴展到 64 個 ACU (Aurora 容量單位),以處理工作負載。處理完成後,在 1000 秒後沒有連線支援的情況下,叢集會關閉,直到連線請求提示重新啟動為止。

對於LinuxmacOS、或Unix:

aws rds restore-db-cluster-from-snapshot \ --db-cluster-identifier mynewdbcluster \ --snapshot-identifier mydbclustersnapshot \ --engine-mode serverless --scaling-configuration MinCapacity=8,MaxCapacity=64,TimeoutAction='ForceApplyCapacityChange',SecondsUntilAutoPause=1000,AutoPause=true

在Windows中:

aws rds restore-db-cluster-from-snapshot ^ --db-instance-identifier mynewdbcluster ^ --db-snapshot-identifier mydbclustersnapshot ^ --engine-mode serverless --scaling-configuration MinCapacity=8,MaxCapacity=64,TimeoutAction='ForceApplyCapacityChange',SecondsUntilAutoPause=1000,AutoPause=true

若要在使用 RDS API 從Aurora Serverless v1資料庫叢集還原時設定資料庫叢集,請執行 RestoredB ClusterFromSnapshot 作業並serverless為參數指定。EngineMode

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

  • Aurora MySQL:1248163264128256

  • Aurora PostgreSQL:248163264192384