Die Cassandra-Datenbank verwendet
dynamisch erstellte nichtflüchtige Volumes zum Speichern von Daten. Für eine ordnungsgemäße Datenbankfunktion müssen Sie in Apigee eine StorageClass-Definition konfigurieren, die von einem Solid-State-Laufwerk (SSD) unterstützt wird.
Wenn Sie derzeit keine SSD für Cassandra konfiguriert haben, wird in diesem Thema erläutert, wie Sie eine neue StorageClass erstellen, die SSD verwendet, und als Standardklasse festlegen. Wenn Cassandra gestartet wird, wird diese Standard-StorageClass verwendet.
Die in diesem Thema beschriebenen Schritte für die StorageClass-Konfiguration gelten nur für eine neue Cassandra-Installation. Wenn Sie bereits eine Cassandra-Klasse installiert haben, müssen Sie den vorhandenen Cluster außer Betrieb nehmen, um die StorageClass-Definition zu konfigurieren. Änderungen an der StorageClass-Definition eines vorhandenen Cassandra-Clusters nach der Installation werden nicht unterstützt.
Apigee empfiehlt, Hybrid in zwei oder mehr Regionen bereitzustellen, um eine Region außer Betrieb zu nehmen und neu zu installieren, während die Daten in der sekundären Region erhalten bleiben. Alternativ können Sie eine Nicht-CSI-Hybridsicherung verwenden, um Daten in einer Installation in einer einzelnen Region nach der Außerbetriebnahme und Konfiguration der erforderlichen StorageClass-Definition wiederherzustellen.
Standard-StorageClass ändern
In den folgenden Schritten wird erläutert, wie Sie eine StorageClass erstellen und als Standardklasse festlegen. Weitere Informationen finden Sie in der Kubernetes-Dokumentation unter Standardspeicherklasse ändern.
Rufen Sie den Namen der aktuellen Standard-StorageClass ab:
kubectl get sc
Beispiel:
kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
premium-rwo pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h
standard kubernetes.io/gce-pd Delete Immediate true 15h
standard-rwo (default) pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h
Beschreiben Sie die StorageClass mit dem Namen standard-rwo. Der Typ lautet pd-balanced:
Erstellen Sie eine neue Datei mit dem Namen storageclass.yaml:
Fügen Sie diesen Code in die Datei ein. Beachten Sie, dass der Name der neuen Klasse apigee-sc ist. Sie können einen beliebigen Namen verwenden. Beachten Sie auch, dass der Speichertyp pd-ssd ist:
[[["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\u003eApigee requires the use of solid-state drives (SSD) for Cassandra, and this setup utilizes dynamically created persistent volumes.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring the StorageClass definition for Cassandra requires the use of SSD, which this process will guide you through.\u003c/p\u003e\n"],["\u003cp\u003eThese StorageClass configuration steps only apply to new Cassandra installations; changes are unsupported for existing Cassandra clusters after installation.\u003c/p\u003e\n"],["\u003cp\u003eTo configure SSD for an existing Cassandra cluster, you must decommission the current cluster; you may use a multi-region setup or a non-CSI backup to preserve your data while you do this.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating a new StorageClass, such as \u003ccode\u003eapigee-sc\u003c/code\u003e, with the storage type \u003ccode\u003epd-ssd\u003c/code\u003e, and setting it as the default StorageClass using Kubernetes commands.\u003c/p\u003e\n"]]],[],null,["# StorageClass configuration\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\n\nThe Cassandra database uses\n[dynamically created](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#dynamic) persistent volumes to store data. For proper database functioning,\nApigee requires you to configure a [StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes)\ndefinition that is backed by a solid-state drive (SSD).\n\n\nIf you do not currently have SSD configured for Cassandra, this topic explains how to create a\nnew StorageClass that uses SSD and make it the\ndefault class. When Cassandra starts, it will use this default StorageClass.\n| **KEY POINT:** Apigee requires the use of SSD for Cassandra.\n\nThe steps outlined in this topic for StorageClass configuration are only applicable to a *new*\nCassandra installation. If you already have a Cassandra class installed, you must decommission the existing\ncluster in order to configure the StorageClass definition. Changes to the StorageClass definition of an\nexisting Cassandra cluster after installation are not supported.\n\nApigee recommends deploying hybrid in [two or more regions](/apigee/docs/hybrid/v1.13/multi-region),\nin order to decommission and re-install one region\nwhile preserving data in the secondary region. Alternatively, you can use a [non-CSI hybrid backup](/apigee/docs/hybrid/v1.13/cassandra-backup-overview#how-to-take-backups) to restore\ndata in a single-region installation, after decommissioning and configuring the required StorageClass definition.\n\n\u003cbr /\u003e\n\nChange the default StorageClass\n-------------------------------\n\n\nThe following steps explain how to create a StorageClass and make it the default class. For more\ninformation, see [Change the default storage class](https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/) in the Kubernetes documentation.\n\n1. Get the name of the current default StorageClass: \n\n ```\n kubectl get sc\n ```\n\n\n For example: \n\n kubectl get sc\n NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE\n premium-rwo pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h\n standard kubernetes.io/gce-pd Delete Immediate true 15h\n standard-rwo (default) pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h\n \n2. Describe the StorageClass named `standard-rwo`. Note that its type is `pd-balanced`: \n\n ```\n kubectl describe sc standard-rwo\n ```\n\n\n For example: \n\n ```text\n kubectl describe sc standard-rwo\n ``` \n\n ```\n Name: standard-rwo\n IsDefaultClass: Yes\n Annotations: components.gke.io/layer=addon,storageclass.kubernetes.io/is-default-class=false\n Provisioner: pd.csi.storage.gke.io\n Parameters: type=pd-balanced\n AllowVolumeExpansion: True\n MountOptions: \u003cnone\u003e\n ReclaimPolicy: Delete\n VolumeBindingMode: WaitForFirstConsumer\n Events: \u003cnone\u003e\n ```\n3. Create a new file called `storageclass.yaml`.\n4. Add this code to the file. Note that the name of the new class is `apigee-sc`. You can use any name you like. Also, note that the storage type is `pd-ssd`: \n\n ```carbon\n ---\n kind: StorageClass\n apiVersion: storage.k8s.io/v1\n metadata:\n name: \"apigee-sc\"\n provisioner: pd.csi.storage.gke.io\n parameters:\n type: pd-ssd\n replication-type: none\n volumeBindingMode: WaitForFirstConsumer\n allowVolumeExpansion: true\n ```\n5. Apply the new StorageClass to your Kubernetes cluster: \n\n ```\n kubectl apply -f storageclass.yaml\n ```\n6. Execute the following two commands to change the default StorageClass: \n\n ```\n kubectl patch storageclass standard-rwo \\\n -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"false\"}}}'\n ``` \n\n ```\n kubectl patch storageclass apigee-sc \\\n -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'\n ```\n7. Execute this command to verify that the new default StorageClass is called `apigee-sc`: \n\n ```\n kubectl get sc\n ```\n\n\n For example: \n\n kubectl get sc\n\n ```\n NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE\n apigee-sc (default) pd.csi.storage.gke.io Delete WaitForFirstConsumer true 14h\n premium-rwo pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h\n standard kubernetes.io/gce-pd Delete Immediate true 15h\n standard-rwo pd.csi.storage.gke.io Delete WaitForFirstConsumer true 15h\n \n ```\n8. Describe both the StorageClass to verify the value of **IsDefaultClass** . \n\n ```\n kubectl describe sc apigee-sc\n ``` \n\n ```\n Name: apigee-sc\n IsDefaultClass: Yes\n Annotations: kubectl.kubernetes.io/last-applied-configuration={\"allowVolumeExpansion\":true,\"apiVersion\":\"storage.k8s.io/v1\",\"kind\":\"StorageClass\",\"metadata\":{\"annotations\":{},\"name\":\"apigee-sc\"},\"parameters\":{\"replication-type\":\"none\",\"type\":\"pd-ssd\"},\"provisioner\":\"pd.csi.storage.gke.io\",\"volumeBindingMode\":\"WaitForFirstConsumer\"}\n ,storageclass.kubernetes.io/is-default-class=true\n Provisioner: pd.csi.storage.gke.io\n Parameters: replication-type=none,type=pd-ssd\n AllowVolumeExpansion: True\n MountOptions: \n ReclaimPolicy: Delete\n VolumeBindingMode: WaitForFirstConsumer\n Events: \n \n ``` \n\n ```\n kubectl describe sc standard-rwo\n ``` \n\n ```\n Name: standard-rwo\n IsDefaultClass: No\n Annotations: components.gke.io/layer=addon,storageclass.kubernetes.io/is-default-class=false\n Provisioner: pd.csi.storage.gke.io\n Parameters: type=pd-balanced\n AllowVolumeExpansion: True\n MountOptions: \n ReclaimPolicy: Delete\n VolumeBindingMode: WaitForFirstConsumer\n Events: \n \n ```"]]