問題
由於 Cassandra 資料庫的磁碟空間不足,Apigee Hybrid 安裝程序失敗。安裝程序失敗,並顯示下列錯誤訊息:
Error: UPGRADE FAILED: cannot patch "default" with kind ApigeeDatastore: Internal error occurred
此外,Cassandra 記錄會包含類似下列內容的警告:
WARN [main] 2024-06-18 12:34:55,583 DatabaseDescriptor.java:579 - Only 62.440GiB free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots
常見的診斷步驟
使用 Apigee Hybrid must-gather 指令碼,從 Cassandra Pod 收集記錄以供審查。
可能原因
原因 | 說明 |
---|---|
磁碟空間不足 | Cassandra 的可用磁碟空間不到 50%。 |
原因 1:磁碟空間不足
升級 Apigee Hybrid 時,請確保所有 Cassandra Pod 的可用磁碟空間超過 50%。
診斷
-
在 Apigee hybrid must-gather 指令碼中,檢查下列指令的輸出內容,確認與 Cassandra 相關聯的磁碟區總大小:
kubectl get pv -n APIGEE_NAMESPACE
輸出內容範例
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE pvc-0b6b2daa-d512-4780-9021-fc97293a8154 10Gi RWO Delete Bound apigee/cassandra-data-apigee-cassandra-default-1 standard-rwo <unset> - 20d pvc-2263fc7c-e057-406a-ad60-38573733c92d 10Gi RWO Delete Bound apigee/cassandra-data-apigee-cassandra-default-2 standard-rwo <unset> - 20d pvc-8c854fe9-adaa-440f-90d9-d15497e7f530 10Gi RWO Delete Bound apigee/cassandra-data-apigee-cassandra-default-0 standard-rwo <unset> - 20d
-
檢查
nodetool
狀態輸出,查看每個 Cassandra Pod 使用的磁碟。 指派給 Cassandra Pod 的永久磁碟區要求 (PVC) 所用磁碟空間,不應超過可用儲存空間容量的 50%。請參閱下列指令:kubectl -n APIGEE_NAMESPACE -c apigee-cassandra exec apigee-cassandra-default-1 -- bash -c 'nodetool -u cassandra -pw $CASS_PASSWORD status'
其中 CASS_PASSWORD 是 設定屬性參考資料中提及的
cassandra.auth.default.password
。輸出內容範例
Datacenter: us-west3 ======================== Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Tokens Owns (effective) Host ID Rack UN 10.10.10.1 6.69 GiB 256 100.0% 2a184030-444-4155-8375-156e87539711 a UN 10.10.10.2 7.42 GiB 256 53.1% f22b66c7-4444-4000-b9c0-5a71ee6315a8 c UJ 10.10.10.3 7.39 GiB 256 ? 78fb2737-4444-4468-a786-e473ead115b5 b UN 10.10.10.4 7.81 GiB 256 47.0% 779fcdf1-4444-4186-bcbb-2844e59629c2 b UN 10.10.10.5 6.91 GiB 256 53.0% 55ca07b2-4444-4967-b321-6477d50f9846 b UN 10.10.10.6 7.41 GiB 256 46.9% 0cf33585-444-46ce-811f-9c6376ed58ac c
(選用) 使用
kubectl
在 Cassandra 容器中執行指令,檢查磁碟用量百分比。kubectl exec -it apigee-cassandra-default-0 -n apigee – df -h /opt/apigee/data
kubectl exec -it apigee-cassandra-default-1 -n apigee – df -h /opt/apigee/data
kubectl exec -it apigee-cassandra-default-2 -n apigee – df -h /opt/apigee/data
範例
以下範例顯示磁碟空間使用率超過 50% 的情況。這會導致 Apigee Hybrid 升級發生問題。
kubectl exec -it apigee-cassandra-default-0 -n apigee -- df -h /opt/apigee/data
Defaulted container "apigee-cassandra" out of: apigee-cassandra, apigee-cassandra-ulimit-init (init) Filesystem Size Used Avail Use% Mounted on /dev/sdb 10G 6G 4G 60% /opt/apigee/data
kubectl exec -it apigee-cassandra-default-1 -n apigee -- df -h /opt/apigee/data
Defaulted container "apigee-cassandra" out of: apigee-cassandra, apigee-cassandra-ulimit-init (init) Filesystem Size Used Avail Use% Mounted on /dev/sdb 10G 5.9G 4.1G 59% /opt/apigee/data
kubectl exec -it apigee-cassandra-default-2 -n apigee -- df -h /opt/apigee/data
Defaulted container "apigee-cassandra" out of: apigee-cassandra, apigee-cassandra-ulimit-init (init) Filesystem Size Used Avail Use% Mounted on /dev/sdb 10G 5.6G 4.4G 56% /opt/apigee/data
解析度
如果發現磁碟使用率超過 50%,請擴充 Cassandra 磁碟容量,確保使用率低於 50%,再執行 Apigee Hybrid 升級。
如要擴充磁碟容量,請參閱「管理 Cassandra 永久儲存空間大小」。
必須收集診斷資訊
如果按照上述操作說明後問題仍未解決,請收集下列診斷資訊,然後與 Google Cloud 客戶服務聯絡:- 您的 Google Cloud 專案 ID。
- 您的 Apigee Hybrid 機構。
- 來源和新地區的
overrides.yaml
檔案 (請記得遮蓋所有私密資訊)。 - Apigee Hybrid 必須收集的指令輸出內容。