Mit diesem Prozess können Sie die nichtflüchtigen Volumes, die von der Apigee Hybrid Cassandra-Datenbank verwendet werden, erweitern, um größere Speicheranforderungen zu erfüllen, ohne neue Knoten erstellen zu müssen, um mehr Speicher bereitzustellen.
Übersicht
Die Apigee Hybrid cassandra-Komponente verwendet nichtflüchtige Volumes zum Speichern von Daten. Die Größe des nichtflüchtigen Volumes wird während Installation und Erstkonfiguration definiert. Diese anfängliche Speichergröße ist ein unveränderlicher Wert. Er kann nicht geändert werden. Daher verwendet jeder dem Cluster neu hinzugefügte Knoten den gleichen nichtflüchtigen Speicherumfang.
Es ist möglich, die Größe des vorhandenen nichtflüchtigen Volumes zu erhöhen. Dazu wenden Sie die Änderungen direkt auf die Nichtflüchtige Volume-Anforderung an. Für neue Knoten wird jedoch weiterhin die kleinere anfängliche Größe des nichtflüchtigen Volumes verwendet.
Wenn Ihre Hybrid-Cassandra-Datenbank die Speicherkapazität nähert, können Sie dieses Verfahren verwenden, um die vorhandenen nichtflüchtigen Volumes zu erweitern und auch neue Knoten erweitern zu können.
Nichtflüchtige Cassandra-Volumes erweitern
Aktualisieren Sie die Volume-Größe auf die gewünschte Größe:
kubectl -n apigee edit pvc
Prüfen Sie die aktualisierte Volume-Kapazität:
kubectl get pvc -n apigee
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
cassandra-data-apigee-cassandra-default-0 Bound pvc-92234ba7-941b-4dab-82c6-8a5288a2c8d4 100Gi RWO standard 21m
cassandra-data-apigee-cassandra-default-1 Bound pvc-6be911fc-91f7-465d-a02e-933428ee10b2 100Gi RWO standard 20m
cassandra-data-apigee-cassandra-default-2 Bound pvc-14ba34e4-fd5c-4d59-8413-a331dcad3404 100Gi RWO standard 19m
Sichern Sie die zustandsorientierte Konfiguration, löschen Sie sie und erstellen Sie sie mit der neuen Speichergröße neu. Die folgenden Befehle erstellen die Konfigurationsdatei apigee-cassandra-default.yaml, mit der Sie die aktuelle Cassandra-Konfiguration erfassen können. Anschließend ändern Sie die Konfiguration und wenden sie an:
kubectl -n apigee get sts apigee-cassandra-default -o yaml > apigee-cassandra-default.yaml
Prüfen Sie, ob der Vorgang delete abgeschlossen ist:
kubectl get sts -n apigee
Die Ausgabe sollte so aussehen:
No resources found in apigee namespace.
Aktualisieren Sie die Speichergröße in der Datei apigee-cassandra-default.yaml durch die neue Speichergröße. Sie muss der Größe entsprechen, die Sie in Ihren overrides.yaml anwenden möchten.
Beispiel:
resources:
requests:
storage: 100Gi
Wenden Sie die zustandsorientierte Konfiguration noch einmal mit der aktualisierten Speichergröße an:
kubectl apply -f apigee-cassandra-default.yaml
Prüfen Sie, ob das StatefulSet korrekt neu erstellt wurde:
kubectl get sts -n apigee
Die Ausgabe sollte in etwa so aussehen:
NAME READY AGE
apigee-cassandra-default 3/3 6m56s
Aktualisieren Sie die Überschreibungsdatei mit der neuen Volume-Größe, die Sie beim Bearbeiten des PVC angegeben haben:
cassandra:storage:capacity:100Gi
Aktualisierte Konfiguration auf den Cluster anwenden:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-28 (UTC)."],[[["\u003cp\u003eThis documentation guides users on expanding the persistent volumes of the Apigee hybrid Cassandra database to accommodate increased storage demands without adding new nodes.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves updating the Persistent Volume Claim (PVC) directly to modify the storage size, although this only affects existing nodes and is not the complete process.\u003c/p\u003e\n"],["\u003cp\u003eExpanding the volume size requires updating the storage size in the \u003ccode\u003eapigee-cassandra-default.yaml\u003c/code\u003e file, deleting the current statefulset, recreating the statefulset, and updating the \u003ccode\u003eoverrides.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eThe procedure is applicable only to Kubernetes storage classes that support PersistentVolume expansion, as indicated in the Kubernetes documentation.\u003c/p\u003e\n"],["\u003cp\u003eVerifying that the storage size of both the statefulset and the Cassandra pods have been updated to the correct size after the process has been completed, is a crucial step.\u003c/p\u003e\n"]]],[],null,["# Expand Cassandra persistent volumes\n\n| You are currently viewing version 1.9 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\nThis process allows you to expand the persistent volumes used by the Apigee hybrid Cassandra\ndatabase to accommodate greater storage needs without needing to create new nodes just to provide\nmore storage.\n\nOverview\n--------\n\nThe Apigee hybrid `cassandra` component uses persistent volumes to store data. The size\nof the persistent volume is defined during installation and initial configuration. This initial\nstorage size is an immutable value and cannot be changed. Therefore, any new node added to the cluster\nwill use the same persistent volume size.\n\nIt is possible to increase the size of the existing persistent volume by making the changes directly on\nthe Persistent volume Claim, but new nodes will still use the smaller initial persistent volume size.\n\nIf your hybrid Cassandra database is nearing its storage capacity, you can use this procedure\nto expand the existing persistent volumes and allow new nodes to expand their persistent volumes as\nwell.\n| **Note:** This process only applies to Kubernetes storage classes that support PersistentVolume expansion. See the **[Allow\n| Volume Expansion list](https://kubernetes.io/docs/concepts/storage/storage-classes/#allow-volume-expansion)** in the Kubernetes documentation.\n|\n|\n| If you do not know what storage class your hybrid installation uses, you can check with\n| the following command. \n|\n| ```\n| kubectl -n apigee get sc standard -o json | grep 'provisioner'\n| ```\n|\n|\n| The output will look something like: \n|\n| ```text\n| \"provisioner\": \"kubernetes.io/gce-pd\",\n| ```\n|\n|\n| Where `gce-pd` is an abbreviation for the *gcePersistentDisk* storage class.\n| You can find a list of storage class abbreviations in the **[Parameters\n| list](https://kubernetes.io/docs/concepts/storage/storage-classes/#parameters)** in the Kubernetes documentation.\n\nExpand Cassandra persistent volumes\n-----------------------------------\n\n1. Update the volume size to the desired size: \n\n ```\n kubectl -n apigee edit pvc\n ```\n2. Check the updated volume capacity: \n\n ```\n kubectl get pvc -n apigee\n ``` \n\n ```text\n NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE\n cassandra-data-apigee-cassandra-default-0 Bound pvc-92234ba7-941b-4dab-82c6-8a5288a2c8d4 100Gi RWO standard 21m\n cassandra-data-apigee-cassandra-default-1 Bound pvc-6be911fc-91f7-465d-a02e-933428ee10b2 100Gi RWO standard 20m\n cassandra-data-apigee-cassandra-default-2 Bound pvc-14ba34e4-fd5c-4d59-8413-a331dcad3404 100Gi RWO standard 19m\n ```\n3. Backup, delete and recreate the statefulset with the new storage size. The following comands creates a configuration file `apigee-cassandra-default.yaml` you can use to capture the current Cassandra configuration. You then modify and apply this configuration:\n 1.\n\n ```\n kubectl -n apigee get sts apigee-cassandra-default -o yaml \u003e apigee-cassandra-default.yaml\n ```\n 2.\n\n ```\n kubectl -n apigee delete sts --cascade=orphan apigee-cassandra-default\n ```\n 3. Check that the `delete` operation is complete: \n\n ```\n kubectl get sts -n apigee\n ```\n\n\n Your output should look like: \n\n ```text\n No resources found in apigee namespace.\n ```\n 4. Update the storage size in the `apigee-cassandra-default.yaml` file with the new storage size. This must match the size you intend to apply in your `overrides.yaml`. For example: \n\n ```text\n resources:\n requests:\n storage: 100Gi\n ```\n 5. Re-apply the statefulset configuration with the updated storage size: \n\n ```\n kubectl apply -f apigee-cassandra-default.yaml\n ```\n 6. Verify that statefulset was re-created correctly: \n\n ```\n kubectl get sts -n apigee\n ```\n\n\n Your output should look something like: \n\n ```text\n NAME READY AGE\n apigee-cassandra-default 3/3 6m56s\n ```\n4. Update the your overrides file with new volume size that you specified when you edited the pvc: \n\n ```actionscript-3\n cassandra:\n storage:\n capacity: 100Gi\n ```\n5. Apply the updated configuration to the cluster: \n\n ```\n ../apigeectl apply --datastore -f overrides/overrides.yaml\n ``` \n\n ```text\n Parsing file: config/values.yaml\n Parsing file: overrides/overrides.yaml\n cleansing older AD's (v1alpha1) istio resources...\n\n Invoking \"kubectl apply\" with YAML config...\n\n apigeedatastore.apigee.cloud.google.com/apigee-cassandra unchanged\n ```\n6. Check if the newly created sts has the updated storage size: \n\n ```\n kubectl get sts -n apigee apigee-cassandra -o yaml |grep storage\n ``` \n\n ```actionscript-3\n storage: 100Gi\n ```\n7.\n Check if C\\* pods data volume got updated with new size:\n\n ```\n kubectl exec -n apigee -it apigee-cassandra-default-0 -- df -h|grep \"/opt/apigee/data\"\n ``` \n\n ```text\n /dev/sdb 99G 69M 99G 1% /opt/apigee/data\n ```"]]