症状
您的 Apigee Hybrid 安装流程因 Cassandra 数据库的磁盘空间不足而失败。安装过程失败,并显示以下错误消息:
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 Customer Care 联系:- 您的 Google Cloud 项目 ID。
- 您的 Apigee Hybrid 组织。
- 来自来源和新区域的
overrides.yaml
文件(请务必遮盖所有敏感信息)。 - Apigee Hybrid must-gather 中的命令的输出。