本頁說明如何提高 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 與管理」>「配額與系統限制」視窗。
- 選取叢集的項目,然後按一下「編輯配額」。
- 在「編輯配額」視窗中,根據建議輸入適當的配額值。
- 在「Request description」(要求說明) 欄位中填寫必要詳細資料,然後按一下「Done」(完成)。
- 按一下「提交要求」。