本頁說明如何增加 AlloyDB 中的叢集儲存空間配額,確保資料庫可用性並避免執行個體停機;此外,也會說明叢集儲存空間配額建議工具的運作方式,以及如何使用這項功能。
AlloyDB 叢集儲存空間配額建議工具可協助您偵測可能達到儲存空間配額的正式版叢集。
AlloyDB 叢集儲存空間配額建議工具會分析特定儲存空間相關指標,並計算叢集的最新儲存空間配額用量。如果使用率超過特定門檻,叢集會收到增加儲存空間配額的建議。建議每天都會產生。
事前準備
如要查看最佳化建議和洞察資料,請先完成下列步驟:
如要取得查看及使用洞察和建議的權限,請確認您具備必要的身分與存取權管理 (IAM) 角色。
Tasks 角色 查看建議 recommender.alloydbViewer或alloydb.viewer。套用建議 recommender.alloydbAdmin或alloydb.admin。詳情請參閱「授予其他使用者存取權」。
列出建議
您可以使用 Google Cloud 控制台、gcloud CLI或 Recommender API,列出叢集儲存空間配額建議。
控制台
前往 Google Cloud 控制台的「Clusters」(叢集) 頁面。
詳情請參閱「透過建議中心查看最佳化建議」。
在「資源」清單表格中找到叢集,然後按一下「問題」欄中的「查看問題」。
「匯總問題」面板會顯示問題清單。選取「儲存空間配額即將用盡」建議資訊卡。
gcloud CLI
如要使用 gcloud CLI 列出叢集儲存空間配額建議,請執行 gcloud recommender recommendations list 指令,如下所示:
gcloud recommender recommendations list \ --project=PROJECT_ID \ --location=LOCATION \ --recommender=google.alloydb.cluster.ReliabilityRecommender \ --filter=recommenderSubtype=INCREASE_CLUSTER_STORAGE_QUOTA
更改下列內容:
PROJECT_ID:專案 ID。LOCATION:叢集所在的區域,例如us-central1。
API
如要使用 Recommendations API 列出叢集儲存空間配額建議,請呼叫 recommendations.list 方法,如下所示:
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/recommenders/google.alloydb.cluster.ReliabilityRecommender/recommendations?filter=recommenderSubtype=INCREASE_CLUSTER_STORAGE_QUOTA
更改下列內容:
PROJECT_ID:專案 ID。LOCATION:叢集所在的區域,例如us-central1。
查看洞察資料和詳細建議
您可以使用 Google Cloud 控制台、gcloud CLI 或 Recommender API,查看需要提高叢集儲存空間配額的叢集洞察資料和詳細建議。
如要查看洞察資料和詳細建議,請按照下列步驟操作:
控制台
在「叢集」頁面的「資源」表格下方,按一下叢集「問題」欄中的「查看問題」。
右側會顯示「匯總問題」面板,其中包含「即將達到儲存空間配額」的洞察資料和詳細建議。
gcloud CLI
執行 gcloud recommender insights list 指令,如下所示:
gcloud recommender insights list \ --project=PROJECT_ID \ --location=LOCATION \ --insight-type=google.alloydb.cluster.ReliabilityInsight \ --filter=insightSubtype=HIGH_STORAGE_UTILIZATION
更改下列內容:
- PROJECT_ID:專案 ID。
- LOCATION:叢集所在的區域,例如
us-central1。
API
呼叫 insights.list 方法,如下所示:
GET https://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/google.alloydb.cluster.ReliabilityInsight/insights?filter=insightSubtype=HIGH_STORAGE_UTILIZATION
更改下列內容:
- PROJECT_ID:專案 ID。
- LOCATION:叢集所在的區域,例如
us-central1。
套用最佳化建議
請仔細評估建議,然後採取下列行動:
控制台
如要實作建議,請按照下列步驟操作:
- 按一下叢集的「編輯配額」。系統會自動顯示「IAM 與管理」>「配額與系統限制」視窗。
- 選取叢集的項目,然後按一下「編輯配額」。
- 在「Edit quota」(編輯配額) 視窗中,根據建議輸入適當的配額值。
- 在「Request description」(要求說明) 欄位中填寫必要詳細資料,然後按一下「Done」(完成)。
- 按一下「提交要求」。