O banco de dados do Cassandra usa volumes permanentes
criados dinamicamente para armazenar dados. Para o funcionamento adequado do banco de dados, a Apigee exige que você configure uma definição de StorageClass que seja baseada em uma unidade de estado sólido (SSD).
Se você não tiver o SSD configurado para o Cassandra, este tópico explica como criar um novo StorageClass que usa o SSD e torná-lo a classe padrão. Quando o Cassandra é iniciado, ele usa essa StorageClass padrão.
Alterar o StorageClass padrão
As etapas a seguir explicam como criar uma StorageClass e torná-la a classe padrão. Para mais informações, consulte
Alterar a classe de armazenamento padrão na documentação do Kubernetes.
Consiga o nome da StorageClass padrão atual:
kubectl get sc
Exemplo:
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
Descreva a StorageClass chamada standard-rwo. Observe que o tipo dela é pd-balanced:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-28 UTC."],[[["\u003cp\u003eThis document pertains to version 1.9 of the Apigee hybrid documentation and focuses on how to change the default storage class.\u003c/p\u003e\n"],["\u003cp\u003eApigee requires the use of Solid-State Drives (SSD) for the Cassandra database's dynamically created persistent volumes.\u003c/p\u003e\n"],["\u003cp\u003eThe provided steps outline how to create a new \u003ccode\u003eStorageClass\u003c/code\u003e using SSD and then set it as the default for your Kubernetes cluster.\u003c/p\u003e\n"],["\u003cp\u003eThe default StorageClass needs to be patched in order to disable the default tag, and then enable it on the newly created \u003ccode\u003eStorageClass\u003c/code\u003e to ensure Cassandra uses SSD.\u003c/p\u003e\n"]]],[],null,["# StorageClass configuration\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\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\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 NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE\n apigee-sc (default) kubernetes.io/gce-pd 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"]]