kubectl -n namespace get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
cassandra-data-apigee-cassandra-default-0 Bound pvc-b247faae-0a2b-11ea-867b-42010a80006e 10Gi RWO standard 15m
...
描述失败的 pod 的 PVC。例如,以下命令描述了绑定到 pod apigee-cassandra-default-0 的 PVC:
kubectl -n apigee describe pvc cassandra-data-apigee-cassandra-default-0
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ProvisioningFailed 3m (x143 over 5h) persistentvolume-controller storageclass.storage.k8s.io "apigee-sc" not found
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[[["\u003cp\u003eThis documentation covers troubleshooting steps for the Cassandra datastore within Apigee hybrid version 1.8, which is now end-of-life and should be upgraded.\u003c/p\u003e\n"],["\u003cp\u003eCassandra pods stuck in the Pending state are often due to insufficient resources, persistent volume creation issues, or a missing Amazon EBS CSI driver in EKS environments, and can be diagnosed using \u003ccode\u003ekubectl describe pods\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eCassandra pods in the CrashLoopBackoff state may be caused by a data center mismatch with previous data or problems with TLS truststore directory, which can be resolved by checking and potentially deleting stale PVCs or ensuring valid TLS certificates are provided.\u003c/p\u003e\n"],["\u003cp\u003eA client container can be created to access Cassandra debugging utilities like \u003ccode\u003ecqlsh\u003c/code\u003e for querying tables and aiding in troubleshooting.\u003c/p\u003e\n"],["\u003cp\u003eThe document provides steps on how to diagnose and resolve issues with Cassandra pods in pending or crashloopbackoff states, and how to set up and utilize a client container for debugging.\u003c/p\u003e\n"]]],[],null,["# Cassandra troubleshooting guide\n\n| You are currently viewing version 1.8 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis topic discusses steps you can take to troubleshoot and fix problems with the\n[Cassandra](/apigee/docs/hybrid/v1.8/what-is-hybrid#cassandra-datastore) datastore. Cassandra is a\npersistent datastore\nthat runs in the `cassandra` component of the\n[hybrid runtime architecture](/apigee/docs/hybrid/v1.8/what-is-hybrid#about-the-runtime-plane).\nSee also\n[Runtime service configuration overview](/apigee/docs/hybrid/v1.8/service-config).\n\nCassandra pods are stuck in the Pending state\n---------------------------------------------\n\n### Symptom\n\n\nWhen starting up, the Cassandra pods remain in the **Pending** state.\n\n### Error message\n\n\nWhen you use `kubectl` to view the pod states, you see that one or more\nCassandra pods are stuck in the `Pending` state. The\n`Pending` state indicates that Kubernetes is unable to schedule the pod\non a node: the pod cannot be created. For example: \n\n kubectl get pods -n \u003cvar translate=\"no\"\u003enamespace\u003c/var\u003e\n\n NAME READY STATUS RESTARTS AGE\n adah-resources-install-4762w 0/4 Completed 0 10m\n apigee-cassandra-default-0 0/1 Pending 0 10m\n ...\n\n### Possible causes\n\n\nA pod stuck in the Pending state can have multiple causes. For example:\n\n### Diagnosis\n\nUse `kubectl`\nto describe the pod to determine the source of the error. For example: \n\n```scdoc\nkubectl -n namespace describe pods pod_name\n```\n\n\nFor example: \n\n```text\nkubectl describe pods apigee-cassandra-default-0 -n apigee\n```\n\n\nThe output may show one of these possible problems:\n\n- If the problem is insufficient resources, you will see a Warning message that indicates insufficient CPU or memory.\n- If the error message indicates that the pod has unbound immediate PersistentVolumeClaims (PVC), it means the pod is not able to create its [Persistent volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).\n\n### Resolution\n\n#### Insufficient resources\n\nModify the Cassandra node pool so that it has sufficient CPU and memory resources.\nSee [Resizing a node pool](https://cloud.google.com/kubernetes-engine/docs/how-to/node-pools#resizing_a_node_pool) for details.\n\n#### Persistent volume not created\n\nIf you determine a persistent volume issue, describe the PersistentVolumeClaim (PVC) to determine\nwhy it is not being created:\n\n1. List the PVCs in the cluster: \n\n ```\n kubectl -n namespace get pvc\n\n NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE\n cassandra-data-apigee-cassandra-default-0 Bound pvc-b247faae-0a2b-11ea-867b-42010a80006e 10Gi RWO standard 15m\n ...\n ```\n2. Describe the PVC for the pod that is failing. For example, the following command describes the PVC bound to the pod `apigee-cassandra-default-0`: \n\n ```\n kubectl -n apigee describe pvc cassandra-data-apigee-cassandra-default-0\n\n Events:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Warning ProvisioningFailed 3m (x143 over 5h) persistentvolume-controller storageclass.storage.k8s.io \"apigee-sc\" not found\n ```\n\n\n Note that in this example, the StorageClass named `apigee-sc` does not exist. To\n resolve this problem, create the missing StorageClass in the cluster, as explained in [Change the default StorageClass](/apigee/docs/hybrid/v1.8/cassandra-config).\n\n\nSee also [Debugging Pods](https://kubernetes.io/docs/tasks/debug-application-cluster/debug-pod-replication-controller#debugging-pods).\n\n#### Missing Amazon EBS CSI driver\n\nIf the hybrid instance is running on an EKS cluster, make sure the EKS cluster is using the\nAmazon EBS container storage interface (CSI) driver. See [Amazon EBS CSI migration frequently asked questions](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi-migration-faq.html) for details.\n\nCassandra pods are stuck in the CrashLoopBackoff state\n------------------------------------------------------\n\n### Symptom\n\n\nWhen starting up, the Cassandra pods remain in the **CrashLoopBackoff** state.\n\n### Error message\n\n\nWhen you use `kubectl` to view the pod states, you see that one or more\nCassandra pods are in the `CrashLoopBackoff` state.\nThis state indicates that Kubernetes is unable to create the pod. For example: \n\n kubectl get pods -n \u003cvar translate=\"no\"\u003enamespace\u003c/var\u003e\n\n NAME READY STATUS RESTARTS AGE\n adah-resources-install-4762w 0/4 Completed 0 10m\n apigee-cassandra-default-0 0/1 CrashLoopBackoff 0 10m\n ...\n\n### Possible causes\n\n\nA pod stuck in the `CrashLoopBackoff` state can have multiple causes. For example:\n\n### Diagnosis\n\n\nCheck the [Cassandra error log](/apigee/docs/hybrid/v1.8/cassandra-logs) to determine the cause of the problem.\n\n1. List the pods to get the ID of the Cassandra pod that is failing: \n\n ```\n kubectl get pods -n namespace\n ```\n2. Check the failing pod's log: \n\n ```\n kubectl logs pod_id -n namespace\n ```\n\n### Resolution\n\n\nLook for the following clues in the pod's log:\n\n#### Data center differs from previous data center\n\n\nIf you see this log message: \n\n```text\nCannot start node if snitch's data center (us-east1) differs from previous data center\n```\n\n- Check if there are any stale or old PVC in the cluster and delete them.\n- If this is a fresh install, delete all the PVCs and re-try the setup. For example: \n\n kubectl -n \u003cvar translate=\"no\"\u003enamespace\u003c/var\u003e get pvc\n kubectl -n \u003cvar translate=\"no\"\u003enamespace\u003c/var\u003e delete pvc cassandra-data-apigee-cassandra-default-0\n\n#### Truststore directory not found\n\n\nIf you see this log message: \n\n```text\nCaused by: java.io.FileNotFoundException: /apigee/cassandra/ssl/truststore.p12\n(No such file or directory)\n```\n\n\nVerify the key and certificates if provided in your overrides file are correct and valid. For\nexample: \n\n```actionscript-3\ncassandra:\n sslRootCAPath: path_to_root_ca-file\n sslCertPath: path-to-tls-cert-file\n sslKeyPath: path-to-tls-key-file\n```\n\nCreate a client container for debugging\n---------------------------------------\n\n\nThis section explains how to create a client container from which you can access\n[Cassandra debugging utilities](https://cassandra.apache.org/doc/latest/tools/cqlsh.html)\nsuch as `cqlsh`. These utilities allow you to query Cassandra tables and\ncan be useful for debugging purposes.\n\n### Create the client container\n\n\nTo create the client container, follow these steps:\n\n1. The container uses the TLS certificate from the `apigee-cassandra-user-setup` pod. The first step is to fetch this certificate name: \n\n ```\n kubectl get secrets -n apigee --field-selector type=kubernetes.io/tls | grep apigee-cassandra-user-setup | awk '{print $1}'\n ```\n\n\n This command returns the certificate name. For example: `apigee-cassandra-user-setup-rg-hybrid-b7d3b9c-tls`.\n2. Open a new file and paste the following pod spec into it: \n\n ```actionscript-3\n apiVersion: v1\n kind: Pod\n metadata:\n labels:\n name: cassandra-client-name # For example: my-cassandra-client\n namespace: apigee\n spec:\n containers:\n - name: cassandra-client-name\n image: \"gcr.io/apigee-release/hybrid/apigee-hybrid-cassandra-client:1.8.8\"\n imagePullPolicy: Always\n command:\n - sleep\n - \"3600\"\n env:\n - name: CASSANDRA_SEEDS\n value: apigee-cassandra-default.apigee.svc.cluster.local\n - name: APIGEE_DML_USER\n valueFrom:\n secretKeyRef:\n key: dml.user\n name: apigee-datastore-default-creds\n - name: APIGEE_DML_PASSWORD\n valueFrom:\n secretKeyRef:\n key: dml.password\n name: apigee-datastore-default-creds\n volumeMounts:\n - mountPath: /opt/apigee/ssl\n name: tls-volume\n readOnly: true\n volumes:\n - name: tls-volume\n secret:\n defaultMode: 420\n secretName: your-secret-name # For example: apigee-cassandra-user-setup-rg-hybrid-b7d3b9c-tls\n restartPolicy: Never\n ```\n3. Save the file with a `.yaml` extension. For example: `my-spec.yaml`.\n4. Apply the spec to your cluster: \n\n ```\n kubectl apply -f your-spec-file.yaml -n apigee\n ```\n5. Log in to the container: \n\n ```\n kubectl exec -n apigee cassandra-client -it -- bash\n ```\n6. Connect to the Cassandra `cqlsh` interface with the following command. Enter the command exactly as shown: \n\n ```\n cqlsh ${CASSANDRA_SEEDS} -u ${APIGEE_DML_USER} -p ${APIGEE_DML_PASSWORD} --ssl\n ```\n\n### Deleting the client pod\n\n\nUse this command to delete the Cassandra client pod: \n\n```\nkubectl delete pods -n apigee cassandra-client\n```\n\nAdditional resources\n--------------------\n\nSee [Introduction to Apigee and Apigee hybrid playbooks](/apigee/docs/api-platform/troubleshoot/playbooks/introduction)."]]