Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird erläutert, wie Sie einen Dataproc Metastore-Dienst löschen.
Sie möchten Ihren Dataproc Metastore-Dienst möglicherweise löschen, wenn Sie Konfigurationseinstellungen ausgewählt haben, die nicht geändert werden können, z. B. den Dienstnamen oder die Hive-Metastore-Version.
Bitten Sie Ihren Administrator, Ihnen die folgenden IAM-Rollen für Ihr Projekt zuzuweisen, um die Berechtigung zu erhalten, die Sie zum Löschen eines Dataproc Metastore-Dienstes benötigen. Dabei gilt das Prinzip der geringsten Berechtigung:
In der folgenden Anleitung wird gezeigt, wie Sie einen Dataproc Metastore-Dienst löschen.
Hinweise
Ihr Cloud Storage-Bucket wird nicht automatisch gelöscht, wenn Sie Ihren Dataproc Metastore löschen. Informationen zum Löschen eines Buckets finden Sie unter Buckets löschen.
Nach dem Löschen eines Dataproc Metastore bleiben automatisch erstellte VPC-Netzwerk-Peering-Routen, die vom Dienst verwendet werden, bis zu 3 Stunden lang erhalten.
Wenn andere Dataproc Metastore-Dienste diese VPC-Netzwerk-Peering-Routen weiterhin verwenden, werden sie nicht gelöscht.
Console
Öffnen Sie in der Google Cloud Console die Seite Dataproc Metastore:
Der Löschschutz für Dataproc Metastore ist eine Funktion, mit der Sie verhindern können, dass vorhandene und neue Dataproc Metastore-Dienste versehentlich entfernt werden. Mit dem Löschschutz können Sie Dienste schützen, die für Ihre Anwendungen und Arbeitslasten wichtig sind.
Hinweise
Standardmäßig ist die Option „Löschschutz“ deaktiviert.
Sie können den Löschschutz nur auf Instanzebene festlegen. Der individuelle Schutz kann nicht für Metadaten wie Tabellen, Datenbanken oder Partitionen festgelegt werden. Sie können den Schutz auch nicht für eine Sicherung aktivieren.
Wenn das Projekt, das eine geschützte Instanz enthält, gelöscht wird, wird die Instanz unabhängig vom Löschschutz ebenfalls gelöscht.
Löschschutz aktivieren
Sie können den Löschschutz beim Erstellen einer Instanz oder für eine vorhandene Instanz aktivieren.
Für neue Dienste
Console
Rufen Sie in der Google Cloud Console die Seite Dataproc Metastore auf.
Klicken Sie auf der Seite Dataproc Metastore auf den Dienstnamen des Dienstes, den Sie aktualisieren möchten.
Die Seite Dienstdetails wird geöffnet.
Klicken Sie auf dem Tab Konfiguration auf Bearbeiten.
Die Seite Dienst bearbeiten wird geöffnet.
Klicken Sie unter Löschschutz auf die Ein/Aus-Schaltfläche, um das Feature zu aktivieren.
Klicken Sie auf Senden.
gcloud-CLI
Führen Sie den folgenden gcloud metastore services update-Befehl aus, um den Löschschutz für einen vorhandenen Dataproc Metastore-Dienst zu aktivieren.
gcloud metastore services update SERVICE \
--location=LOCATION \
--deletion-protection
Ersetzen Sie Folgendes:
SERVICE: Der Name des Dataproc Metastore-Dienstes, den Sie löschen.
LOCATION: Die Google Cloud Region, in der sich Ihr Dataproc Metastore-Dienst befindet.
Löschschutz deaktivieren
Wenn Sie den Löschschutz für einen Dataproc Metastore-Dienst deaktivieren möchten, führen Sie den folgenden gcloud metastore services update-Befehl mit der Option --no=deletion-protection aus.
gcloud metastore services update SERVICE \
--location=LOCATION \
--no-deletion-protection
[[["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-27 (UTC)."],[[["\u003cp\u003eThis page outlines the process for deleting a Dataproc Metastore service, which might be necessary if you've chosen unchangeable configurations like the service name or Hive metastore version.\u003c/p\u003e\n"],["\u003cp\u003eDeleting a Dataproc Metastore service is permanent and irreversible, although new services can be quickly created as needed.\u003c/p\u003e\n"],["\u003cp\u003eYou need specific IAM roles, such as \u003ccode\u003eroles/metastore.editor\u003c/code\u003e or \u003ccode\u003eroles/metastore.admin\u003c/code\u003e, to get the necessary \u003ccode\u003emetastore.services.delete\u003c/code\u003e permission to delete a service.\u003c/p\u003e\n"],["\u003cp\u003eThe process for deleting a Dataproc Metastore service can be done through the Google Cloud console, gcloud CLI, or REST API, and the associated Cloud Storage bucket will not be deleted automatically.\u003c/p\u003e\n"],["\u003cp\u003eDataproc Metastore offers a deletion-protection feature that, when enabled, prevents accidental deletion of both new and existing services, which can be managed via the Google Cloud Console or the gcloud CLI.\u003c/p\u003e\n"]]],[],null,["# Delete a Dataproc Metastore service\n\nThis page explains how to delete a Dataproc Metastore service.\n\nYou might want to delete your Dataproc Metastore service if you\nchose some configuration settings that can't be changed, such as the service\nname or the Hive metastore version.\n\nBefore you begin\n----------------\n\n- [Enable Dataproc Metastore in your project](/dataproc-metastore/docs/enable-service).\n- [Create a Dataproc Metastore service](/dataproc-metastore/docs/create-service).\n\n### Required roles\n\n\nTo get the permission that\nyou need to delete a Dataproc Metastore service,\n\nask your administrator to grant you the\nfollowing IAM roles on your project, based on the principle of least privilege:\n\n- [Grant full control of Dataproc Metastore resources](/iam/docs/roles-permissions/metastore#metastore.editor) (`roles/metastore.editor`)\n- [Grant full access to all Dataproc Metastore resources, including IAM policy administration](/iam/docs/roles-permissions/metastore#metastore.admin) (`roles/metastore.admin`)\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains the\n` metastore.services.delete`\npermission,\nwhich is required to\ndelete a Dataproc Metastore service.\n\n\nYou might also be able to get\nthis permission\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\nFor more information about specific Dataproc Metastore roles and permissions, see [Dataproc Metastore IAM overview](/dataproc-metastore/docs/iam-and-access-control).\n\n\u003cbr /\u003e\n\nDelete a service\n----------------\n\nThe following instructions demonstrate how to delete a Dataproc Metastore\nservice.\n\n### Considerations\n\n- Your Cloud Storage bucket isn't automatically deleted when you delete your\n Dataproc Metastore. To delete a bucket, see [Deleting buckets](/storage/docs/deleting-buckets).\n\n- After deleting a Dataproc Metastore, auto-created\n VPC Network Peering routes used by the service persist for up to 3 hours.\n Note that if any other Dataproc Metastore services continue to\n use these VPC Network Peering routes, they aren't deleted.\n\n**Caution:** Deleting a service is permanent. Once deleted, a service can't be restored. You can, however, quickly create new Dataproc Metastore services as you need them. \n\n### Console\n\n1. In the Google Cloud console, open the **Dataproc Metastore** page:\n\n [Go to Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services)\n2. Select the service you want to delete.\n\n3. In the navigation bar, click **Delete**.\n\n A dialog opens.\n4. On the dialog, click **Delete**.\n\n Return to the **Dataproc Metastore** page, and\n verify that your deleted service no longer appears in the list.\n\nYou can also delete your service on the Service detail page.\n\n1. On the **Dataproc Metastore** page, click the service that you want to\n delete.\n\n The **Service detail** page for that service opens.\n2. In the navigation bar, click **Delete Service**.\n\n A dialog opens.\n3. On the dialog, click **Delete**.\n\n Return to the **Dataproc Metastore** page, and\n verify that your deleted service no longer appears in the list.\n\n### gcloud CLI\n\n1. To delete a service, run the following [`gcloud metastore services delete`](/sdk/gcloud/reference/metastore/services/delete) command.\n\n ```\n gcloud metastore services delete SERVICE \\\n --location=LOCATION\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e: The name of the Dataproc Metastore service you're deleting.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The Google Cloud region that your Dataproc Metastore service resides in.\n2. Verify that the deletion was successful.\n\n### REST\n\nFollow the API instructions to [delete a service](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/delete)\nby using the APIs Explorer.\n\nDeletion-protection\n-------------------\n\nDataproc Metastore deletion protection is a feature that helps you\nprevent the accidental removal of existing and new Dataproc Metastore\nservices. By using deletion protection, you can safeguard services that are\nimportant to your applications and workloads.\n\n### Considerations\n\n- By default, the deletion protection option is disabled.\n\n- You can only set deletion protection at the instance level. Individual\n protection can't be set on metadata, such as tables, databases or\n partitions. You also can't enable protection on a backup.\n\n- If the project containing a protected instance is deleted, the instance is\n also deleted, irrespective of deletion-protection.\n\n### Enable deletion-protection\n\nYou can enable deletion protection when you create an instance or\non an existing instance.\n\n#### For new services\n\n### Console\n\n1. In the Google Cloud console, go to the **Dataproc Metastore**\n page.\n\n [Go to\n Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services)\n2. In the navigation bar, click **+Create**.\n\n The **Create Metastore service** dialog opens.\n3. Select **Dataproc Metastore 2**.\n\n4. Under **Deletion protection**, click the toggle to enable the feature.\n\n5. Configure the remaining service options as necessary, or use the provided\n defaults.\n\n6. Click **Submit**.\n\n### gcloud CLI\n\nTo enable deletion-protection on a new Dataproc Metastore service,\nrun the following [`gcloud metastore services create`](/sdk/gcloud/reference/metastore/services/delete) command. \n\n```\ngcloud metastore services update SERVICE \\\n --location=LOCATION \\\n --instance-sizeINSTANCE_SIZE \\\n --deletion-protection\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e: The name of the Dataproc Metastore service you're deleting.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The Google Cloud region that your Dataproc Metastore service resides in.\n- \u003cvar translate=\"no\"\u003eINSTANCE\u003c/var\u003e: The [instance size](/dataproc-metastore/pricing#service-2-scaling) for your service.\n\n#### For existing services\n\n### Console\n\n1. In the Google Cloud console, open the **Dataproc Metastore** page:\n\n [Go to Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services)\n2. On the **Dataproc Metastore** page, click the service name of the\n service that you want to update.\n\n The **Service detail** page opens.\n3. On the **Configuration** tab, click **Edit**.\n\n The **Edit service** page opens.\n4. Under **Deletion protection**, click the toggle to enable the feature.\n\n5. Click **Submit**.\n\n### gcloud CLI\n\nTo enable deletion-protection on an existing Dataproc Metastore service,\nrun the following [`gcloud metastore services update`](/sdk/gcloud/reference/metastore/services/delete) command. \n\n```\ngcloud metastore services update SERVICE \\\n --location=LOCATION \\\n --deletion-protection\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e: The name of the Dataproc Metastore service you're deleting.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The Google Cloud region that your Dataproc Metastore service resides in.\n\nDisable deletion-protection\n---------------------------\n\nTo disable deletion-protection on a Dataproc Metastore service, run\nfollowing [`gcloud metastore services update`](/sdk/gcloud/reference/metastore/services/delete)\ncommand with the `--no=deletion-protection` option. \n\n```\ngcloud metastore services update SERVICE \\\n --location=LOCATION \\\n --no-deletion-protection\n```\n\nWhat's next\n-----------\n\n- [Cloud audit logging](/dataproc-metastore/docs/audit-logging)\n- [Dataproc Metastore IAM and access control](/dataproc-metastore/docs/iam-and-access-control)\n- [Service access](/dataproc-metastore/docs/access-service)"]]