Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara menghapus layanan Dataproc Metastore.
Anda mungkin ingin menghapus layanan Dataproc Metastore jika Anda
memilih beberapa setelan konfigurasi yang tidak dapat diubah, seperti nama
layanan atau versi metastore Hive.
Untuk mendapatkan izin yang
diperlukan untuk menghapus layanan Dataproc Metastore,
minta administrator untuk memberi Anda
peran IAM berikut di project Anda, berdasarkan prinsip hak istimewa paling rendah:
Untuk mengetahui informasi selengkapnya tentang peran dan izin Dataproc Metastore tertentu, lihat Ringkasan IAM Dataproc Metastore.
Hapus layanan
Petunjuk berikut menunjukkan cara menghapus layanan Dataproc Metastore.
Pertimbangan
Bucket Cloud Storage Anda tidak otomatis dihapus saat Anda menghapus Dataproc Metastore. Untuk menghapus bucket, lihat Menghapus bucket.
Setelah menghapus Dataproc Metastore, rute VPC Network Peering yang dibuat otomatis dan digunakan oleh layanan akan tetap ada hingga 3 jam.
Perhatikan bahwa jika ada layanan Dataproc Metastore lain yang terus menggunakan rute Peering Jaringan VPC ini, layanan tersebut tidak akan dihapus.
Konsol
Di konsol Google Cloud , buka halaman Dataproc Metastore:
gcloud metastore services delete SERVICE \
--location=LOCATION
Ganti kode berikut:
SERVICE: Nama layanan Dataproc Metastore yang Anda hapus.
LOCATION: Region Google Cloud tempat layanan Dataproc Metastore Anda berada.
Verifikasi bahwa penghapusan berhasil.
REST
Ikuti petunjuk API untuk menghapus layanan
menggunakan APIs Explorer.
Perlindungan penghapusan
Perlindungan penghapusan Dataproc Metastore adalah fitur yang membantu Anda mencegah penghapusan layanan Dataproc Metastore yang ada dan yang baru secara tidak sengaja. Dengan menggunakan perlindungan penghapusan, Anda dapat mengamankan layanan yang penting untuk aplikasi dan workload Anda.
Pertimbangan
Secara default, opsi perlindungan penghapusan dinonaktifkan.
Anda hanya dapat menyetel perlindungan penghapusan di tingkat instance. Perlindungan
individu tidak dapat ditetapkan pada metadata, seperti tabel, database, atau
partisi. Anda juga tidak dapat mengaktifkan perlindungan pada cadangan.
Jika project yang berisi instance yang dilindungi dihapus, instance tersebut juga akan dihapus, terlepas dari perlindungan penghapusan.
Mengaktifkan perlindungan penghapusan
Anda dapat mengaktifkan perlindungan penghapusan saat membuat instance atau
pada instance yang sudah ada.
Untuk layanan baru
Konsol
Di konsol Google Cloud , buka halaman Dataproc Metastore.
Di halaman Dataproc Metastore, klik nama layanan yang ingin Anda perbarui.
Halaman Service detail akan terbuka.
Di tab Configuration, klik Edit.
Halaman Edit layanan akan terbuka.
Di bagian Perlindungan penghapusan, klik tombol untuk mengaktifkan fitur ini.
Klik Kirim.
gcloud CLI
Untuk mengaktifkan perlindungan penghapusan pada layanan Dataproc Metastore yang ada,
jalankan perintah gcloud metastore services update berikut.
gcloud metastore services update SERVICE \
--location=LOCATION \
--deletion-protection
Ganti kode berikut:
SERVICE: Nama layanan Dataproc Metastore yang Anda hapus.
LOCATION: Region Google Cloud tempat layanan Dataproc Metastore Anda berada.
Menonaktifkan perlindungan penghapusan
Untuk menonaktifkan perlindungan penghapusan pada layanan Dataproc Metastore, jalankan perintah gcloud metastore services update berikut dengan opsi --no=deletion-protection.
gcloud metastore services update SERVICE \
--location=LOCATION \
--no-deletion-protection
[[["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-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)"]]