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

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

還原 Aurora Serverless v1 資料庫叢集

重要

AWS 已宣布 的end-of-lifeAurora Serverless v1:2025 年 3 月 31 日。所有未在 2025 年 3 月 31 日之前遷移的Aurora Serverless v1叢集都會Aurora Serverless v2在維護時段期間遷移至 。如果升級失敗,Amazon Aurora 會在維護時段將 Serverless v1 叢集轉換為具有同等引擎版本的佈建叢集。如果適用,Amazon Aurora 將在 Amazon RDS 延伸支援中註冊轉換後的佈建叢集。如需詳細資訊,請參閱使用 Amazon RDSAmazon Aurora 的 延伸支援

當您使用 Aurora Serverless v1 AWS CLI 或 RDS API 還原佈建的資料庫叢集快照時,可以設定資料庫叢集。

在您將快照還原至 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 會自動恢復處理容量,並調整規模以應付流量。

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

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

在您將快照還原至 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 Serverless v1

若要將快照還原至與 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 叢集。

對於 Linux、 macOS或 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 秒後沒有連線支援的情況下,叢集會關閉,直到連線請求提示重新啟動為止。

對於 Linux、 macOS或 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 資料庫叢集,請執行 RestoreDBClusterFromSnapshot 操作,並為 serverless 參數指定 EngineMode

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

  • Aurora MySQL:1248163264128256

  • Aurora PostgreSQL:248163264192384