Proses ini memungkinkan Anda memperluas volume persisten yang digunakan oleh database Cassandra hibrida Apigee untuk mengakomodasi kebutuhan penyimpanan yang lebih besar tanpa perlu membuat node baru hanya untuk menyediakan penyimpanan yang lebih besar.
Ringkasan
Komponen cassandra campuran Apigee menggunakan volume persisten untuk menyimpan data. Ukuran volume persisten ditentukan selama penginstalan dan konfigurasi awal. Ukuran penyimpanan awal ini adalah nilai yang tidak dapat diubah dan tidak dapat diubah. Oleh karena itu, setiap node baru yang ditambahkan ke cluster
akan menggunakan ukuran volume persisten yang sama.
Anda dapat meningkatkan ukuran volume persisten yang ada dengan melakukan perubahan secara langsung pada
Klaim volume Persisten. Node baru akan tetap menggunakan ukuran volume persisten awal yang lebih kecil.
Jika database Cassandra hibrida Anda mendekati kapasitas penyimpanannya, Anda dapat menggunakan prosedur ini
untuk memperluas volume persisten yang ada dan mengizinkan node baru untuk memperluas volume persistennya juga.
Memperluas volume persisten Cassandra
Perbarui ukuran volume ke ukuran yang diinginkan:
kubectl -n APIGEE_NAMESPACE edit pvc
Periksa kapasitas volume yang diperbarui:
kubectl get pvc -n APIGEE_NAMESPACE
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
cassandra-data-apigee-cassandra-default-0 Bound pvc-92234ba7-941b-4dab-82c6-8a5288a2c8d4 500Gi RWO standard 21m
cassandra-data-apigee-cassandra-default-1 Bound pvc-6be911fc-91f7-465d-a02e-933428ee10b2 500Gi RWO standard 20m
cassandra-data-apigee-cassandra-default-2 Bound pvc-14ba34e4-fd5c-4d59-8413-a331dcad3404 500Gi RWO standard 19m
Cadangkan, hapus, dan buat ulang statefulset dengan ukuran penyimpanan baru. Perintah berikut
akan membuat file konfigurasi apigee-cassandra-default.yaml yang dapat Anda gunakan untuk mengambil
konfigurasi Cassandra saat ini. Kemudian, Anda akan mengubah dan menerapkan konfigurasi ini:
kubectl -n APIGEE_NAMESPACE get sts apigee-cassandra-default -o yaml > apigee-cassandra-default.yaml
Perbarui ukuran penyimpanan dalam file apigee-cassandra-default.yaml dengan ukuran penyimpanan baru. Nilai ini harus cocok dengan ukuran yang ingin Anda terapkan di overrides.yaml.
Contoh:
resources:
requests:
storage: 500Gi
Terapkan kembali konfigurasi statefulset dengan ukuran penyimpanan yang diperbarui:
kubectl apply -f apigee-cassandra-default.yaml
Pastikan statefulset dibuat ulang dengan benar:
kubectl get sts -n APIGEE_NAMESPACE
Output Anda akan terlihat seperti ini:
NAME READY AGE
apigee-cassandra-default 3/3 6m56s
Perbarui file penggantian dengan ukuran volume baru yang Anda tentukan saat mengedit pvc:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eThis procedure allows for expanding the storage capacity of Apigee hybrid Cassandra persistent volumes without adding new nodes, which is useful when the database nears its storage limit.\u003c/p\u003e\n"],["\u003cp\u003eThe initial persistent volume size for Apigee hybrid Cassandra is immutable; however, existing volumes can be increased by directly modifying the Persistent Volume Claim.\u003c/p\u003e\n"],["\u003cp\u003eTo increase storage, users must first edit the Persistent Volume Claim, delete the existing Cassandra statefulset, update a configuration file with the new size, and then re-apply the statefulset with the updated storage configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe storage class of the Kubernetes environment must support PersistentVolume expansion for this process to be effective, and users can check their storage class using a provided command.\u003c/p\u003e\n"],["\u003cp\u003eAfter expanding the Persistent Volume Claim and updating the configuration, users should update the \u003ccode\u003eoverrides.yaml\u003c/code\u003e file with the new storage size, and then apply the changes using Helm.\u003c/p\u003e\n"]]],[],null,["# Manage Cassandra persistent volume size\n\n| You are currently viewing version 1.13 of the Apigee hybrid documentation. 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\nto store data. Persistent volume size 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. 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_NAMESPACE 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_NAMESPACE edit pvc\n ```\n2. Check the updated volume capacity: \n\n ```\n kubectl get pvc -n APIGEE_NAMESPACE\n ``` \n\n ```\n NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE\n cassandra-data-apigee-cassandra-default-0 Bound pvc-92234ba7-941b-4dab-82c6-8a5288a2c8d4 500Gi RWO standard 21m\n cassandra-data-apigee-cassandra-default-1 Bound pvc-6be911fc-91f7-465d-a02e-933428ee10b2 500Gi RWO standard 20m\n cassandra-data-apigee-cassandra-default-2 Bound pvc-14ba34e4-fd5c-4d59-8413-a331dcad3404 500Gi RWO standard 19m\n ```\n3. Backup, delete and recreate the statefulset with the new storage size. The following commands 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_NAMESPACE get sts apigee-cassandra-default -o yaml \u003e apigee-cassandra-default.yaml\n ```\n 2.\n\n ```\n kubectl -n APIGEE_NAMESPACE 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_NAMESPACE\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: 500Gi\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_NAMESPACE\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 storageSize: 500Gi\n ```\n5. See [`cassandra.storage.capacity`](/apigee/docs/hybrid/v1.13/config-prop-ref#cassandra-storage-capacity) for more details.\n6. Apply the updated configuration to the cluster: \n\n ```\n helm upgrade datastore apigee-datastore/ \\\n --namespace APIGEE_NAMESPACE \\\n --atomic \\\n -f OVERRIDES_FILE.yaml\n ```\n | **Note:** If you see an error saying `Error: UPGRADE FAILED: \"datastore\" has no deployed releases`, replace `upgrade` with `install` and try the command again.\n7. Check if the newly created sts has the updated storage size: \n\n ```\n kubectl get sts -n APIGEE_NAMESPACE apigee-cassandra -o yaml |grep storage\n ``` \n\n ```\n storage: 500Gi\n ```\n8.\n Check if C\\* pods data volume got updated with new size:\n\n ```\n kubectl exec -n APIGEE_NAMESPACE -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 ```"]]