[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-27。"],[[["\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)"]]