Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara memulihkan layanan Dataproc Metastore dari cadangan.
Cadangan adalah snapshot setelan konfigurasi dan metadata yang disimpan dalam layanan Dataproc Metastore. Anda dapat menggunakan fitur pemulihan untuk menyiapkan layanan Dataproc Metastore baru dengan cepat menggunakan data yang sebelumnya disimpan dalam cadangan.
Untuk mendapatkan izin yang Anda perlukan untuk memulihkan layanan Dataproc Metastore dari cadangan,
minta administrator Anda untuk memberi Anda
peran IAM berikut:
Untuk memberikan kontrol penuh atas resource Dataproc Metastore guna menyelesaikan pencadangan, salah satu dari:
Untuk menggunakan objek Cloud Storage yang menyimpan pencadangan terjadwal:
Pengguna Objek Cloud Storage (roles/storage.objectUser)
di agen layanan Dataproc Metastore
Peran bawaan ini berisi
izin yang diperlukan untuk memulihkan layanan Dataproc Metastore dari cadangan. Untuk melihat izin yang benar-benar diperlukan, luaskan bagian Izin yang diperlukan:
Izin yang diperlukan
Izin berikut diperlukan untuk memulihkan layanan Dataproc Metastore dari cadangan:
Untuk memulihkan layanan metadata:
metastore.services.restore, metastore.backups.use
Untuk mengetahui informasi selengkapnya tentang peran dan izin Dataproc Metastore tertentu, lihat Ringkasan IAM Dataproc Metastore.
Tentang memulihkan dari cadangan
Saat memulihkan layanan dari cadangan, Anda dapat memilih salah satu
opsi berikut:
Memulihkan semua metadata dan setelan konfigurasi yang disimpan dalam cadangan.
Memulihkan semua metadata, tetapi tidak memulihkan setelan konfigurasi yang disimpan dalam cadangan. Sebagai gantinya, layanan Anda akan mempertahankan setelan konfigurasi saat ini.
Setelan konfigurasi mencakup parameter Dataproc Metastore
seperti nama layanan, nomor port, dan setelan jaringan.
Metadata mencakup semua informasi database dan tabel yang disimpan dalam layanan Dataproc Metastore.
Pertimbangan
Saat operasi pemulihan sedang berjalan, Anda tidak dapat memperbarui layanan, misalnya, Anda tidak dapat mengubah setelan konfigurasi. Namun, Anda tetap dapat menggunakan layanan untuk operasi normal, seperti menggunakannya untuk mengakses metadatanya dari cluster Dataproc terlampir atau cluster yang dikelola sendiri.
Label Dataproc Metastore tidak dipulihkan.
Data yang disimpan di direktori gudang tidak dipulihkan.
Pemulihan dari cadangan tidak memulihkan atau menggantikan kebijakan IAM dengan hak akses terperinci.
Memulihkan dari cadangan terjadwal mengharuskan cadangan Anda berada di bucket Cloud Storage.
Memulihkan dari cadangan
Untuk memulihkan layanan Dataproc Metastore dari cadangan, selesaikan langkah-langkah berikut.
Jika menggunakan konsol Google Cloud , Anda hanya dapat memulihkan metadata dari cadangan yang dibuat di project dan region yang sama dengan layanan baru Anda.
Jika menggunakan Google Cloud CLI atau Dataproc Metastore API, Anda dapat memulihkan metadata dari cadangan yang dibuat di project dan region lain (cadangan lintas layanan).
Konsol
Di konsol Google Cloud , buka halaman Dataproc Metastore:
PROJECT_ID: project ID Google Cloud
project tempat layanan Dataproc Metastore Anda berada.
LOCATION: region tempat layanan Dataproc Metastore Anda berada. Google Cloud
BACKUP: Opsional: ID file cadangan yang Anda pulihkan. Nilai ini dapat berupa ID cadangan, URL yang sepenuhnya memenuhi syarat, atau nama relatif dalam format berikut:
projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}.
RESTORE_TYPE: jenis operasi pemulihan yang akan dilakukan.
Nilai yang diterima mencakup metadata-only atau full. Nilai defaultnya adalah metadata-only.
BACKUP_LOCATION: Opsional: Lokasi Cloud Storage
dari cadangan terjadwal Anda.
Contoh: gs://my-bucket/path/to/location.
Verifikasi bahwa operasi pemulihan berhasil.
Setelah pemulihan selesai, Dataproc Metastore akan otomatis kembali ke status aktif, terlepas dari apakah pemulihan berhasil atau tidak.
[[["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 of restoring a Dataproc Metastore service using a previously created backup, which includes the service's configuration and metadata.\u003c/p\u003e\n"],["\u003cp\u003eRestoration can be done to either restore both metadata and configuration settings, or only metadata while retaining the current service configuration.\u003c/p\u003e\n"],["\u003cp\u003eRestoring a service requires specific IAM roles and permissions, including Dataproc Metastore Editor or Administrator, and Cloud Storage Object User roles.\u003c/p\u003e\n"],["\u003cp\u003eThe restore operation can be initiated through the Google Cloud console, the gcloud CLI, or via REST APIs, with cross-service backups supported through the CLI and APIs.\u003c/p\u003e\n"],["\u003cp\u003eDuring a restore operation, the service cannot be updated, although it remains usable for accessing metadata, and the restore history, viewable in the console, is limited to the last 25 restores.\u003c/p\u003e\n"]]],[],null,["# Restore Dataproc Metastore from a backup\n\nThis page explains how to restore a Dataproc Metastore service\nfrom a [backup](/dataproc-metastore/docs/backup-metadata).\n\nA backup is a snapshot of the configuration settings and metadata stored in\na Dataproc Metastore service. You can use the restore feature\nto quickly set up a new Dataproc Metastore service with\nthe data previously saved in a backup.\n\nBefore you begin\n----------------\n\n- [Enable Dataproc Metastore](/dataproc-metastore/docs/enable-service) in your project.\n- [Create a Dataproc Metastore service](/dataproc-metastore/docs/create-service).\n- [Back up a Dataproc Metastore service](/dataproc-metastore/docs/backup-metadata).\n\n### Required roles\n\n\nTo get the permissions that\nyou need to restore a Dataproc Metastore service from a backup,\n\nask your administrator to grant you the\nfollowing IAM roles:\n\n- To grant full control of Dataproc Metastore resources to complete a backup, either the:\n - [Dataproc Metastore Editor](/iam/docs/roles-permissions/metastore#metastore.editor) (`roles/metastore.editor`) on the metadata service.\n - [Dataproc Metastore Administrator](/iam/docs/roles-permissions/metastore#metastore.admin) (`roles/metastore.admin`) on the project.\n- To use the Cloud Storage object that stores scheduled backups: [Cloud Storage Object User](/iam/docs/roles-permissions/storage#storage.objectUser) (`roles/storage.objectUser`) on the Dataproc Metastore service agent\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThese predefined roles contain\n\nthe permissions required to restore a Dataproc Metastore service from a backup. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to restore a Dataproc Metastore service from a backup:\n\n- To restore a metadata service: ` metastore.services.restore, metastore.backups.use`\n- To use the Cloud Storage object:\n - ` orgpolicy.policy.get `\n - ` resourcemanager.projects.get `\n - ` resourcemanager.projects.list `\n - ` storage.managedFolders.create `\n - ` storage.managedFolders.delete `\n - ` storage.managedFolders.get `\n - ` storage.managedFolders.list `\n - ` ``storage.multipartUploads.*`` `\n - ` storage.objects.create `\n - ` storage.objects.delete `\n - ` storage.objects.get `\n - ` storage.objects.list `\n - ` storage.objects.restore `\n - ` storage.objects.update`\n\n\nYou might also be able to get\nthese permissions\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\nAbout restoring from a backup\n-----------------------------\n\nWhen you restore a service from a backup, you can choose one of the\nfollowing options:\n\n- Restore all metadata and the configuration settings saved in the backup.\n- Restore all metadata, but don't restore the configuration settings saved in\n the backup. Instead, your service retains your current configuration settings.\n\n *Configuration settings* include Dataproc Metastore parameters\n such as service name, port number, and network settings.\n *Metadata* includes all the database and table information stored in a\n Dataproc Metastore service.\n\n### Considerations\n\n- While a restore operation is running, you can't update your\n service --- for example, you can't change configuration settings. However, you\n can still use your service for normal operations, such as using it to access\n its metadata from attached Dataproc or self-managed clusters.\n\n- Dataproc Metastore labels aren't restored.\n\n- Data stored in the warehouse directory isn't restored.\n\n- Restoring from a backup doesn't restore or replace fine-grained\n IAM policies.\n\n- Restoring from a scheduled backup requires that your backup is located in a\n Cloud Storage bucket.\n\nRestore from a backup\n---------------------\n\nTo restore a Dataproc Metastore service from a backup, complete\nthe following steps.\n\n- If you're using the Google Cloud console, you can only restore metadata from a\n backup that was created in the same project and region as\n your new service.\n\n- If you use the Google Cloud CLI or Dataproc Metastore APIs,\n you can restore metadata from a backup created in a different project and\n region (cross-service backup).\n\n### Console\n\n1. In the Google Cloud console, open the **Dataproc Metastore** page:\n\n [Open Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services)\n2. On the **Dataproc Metastore** page, click the name of the service\n you want to restore from a backup.\n\n The **Service detail** page opens.\n **Figure 1.** The Dataproc Metastore service detail page\n3. To view your backups, click the **Backup/Restore** tab.\n\n4. Select the backup you want to use. To do this, click the menu icon\n more_vert and select\n **Restore**.\n\n The **Restore** page opens.\n\n You can also restore your service on the **Backup detail** page.\n To do this, click the name of the backup and then click **Restore**.\n5. Select the appropriate restore operation:\n\n - **Restore metastore data**. Restores all metadata, but doesn't restore the configuration settings saved in the backup\n - **Restore metastore data and service configuration**. Restores all metadata and the all configuration settings saved in the backup.\n6. To update the service, click **Restore**.\n\n Return to the **Dataproc Metastore** page, and\n verify that your service was successfully backed up.\n\n When the restore completes, Dataproc Metastore\n automatically returns to the [active state](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services?_gl=1*1qaoqiw*_ga*MTIzMTkxNzU5Ni4xNjYzNzk5NTI1*_ga_WH2QY8WWF5*MTY2MzgwMzk0MC4xOS4xLjE2NjM4MDQxNTAuMC4wLjA.#state) regardless of whether or\n not the restore succeeded.\n\n### gcloud CLI\n\n1. To restore a Dataproc Metastore service, run the\n following [`gcloud metastore services restore`](https://cloud.google.com/sdk/gcloud/reference/metastore/services/restore) command:\n\n ```\n gcloud metastore services restore SERVICE \\\n --project=PROJECT_ID \\\n --location=LOCATION \\\n --backup=BACKUP \\\n --restore-type=RESTORE_TYPE \\\n --backup-location=BACKUP_LOCATION\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e: the name of your Dataproc Metastore service.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID of the Google Cloud project your Dataproc Metastoreservice resides in.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the Google Cloud region that your Dataproc Metastore service resides.\n - \u003cvar translate=\"no\"\u003eBACKUP\u003c/var\u003e: Optional: the identifier of the backup file you're restoring from. This value can be the backup ID, a fully qualified URL, or the relative name in the following format: `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.\n - \u003cvar translate=\"no\"\u003eRESTORE_TYPE\u003c/var\u003e: the type of restore operation to perform. Accepted values include `metadata-only` or `full`. The default value is `metadata-only`.\n - \u003cvar translate=\"no\"\u003eBACKUP_LOCATION\u003c/var\u003e: Optional: The Cloud Storage location of your scheduled backup. For example: `gs://my-bucket/path/to/location`.\n2. Verify that the restore operation was successful.\n\n When the restore completes, Dataproc Metastore\n automatically returns to the [active state](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services?_gl=1*1qaoqiw*_ga*MTIzMTkxNzU5Ni4xNjYzNzk5NTI1*_ga_WH2QY8WWF5*MTY2MzgwMzk0MC4xOS4xLjE2NjM4MDQxNTAuMC4wLjA.#state) regardless of whether or\n not the restore succeeded.\n\n### REST\n\nFollow the API instructions to [restore metadata into a service](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/restore)\nby using the APIs Explorer.\n\nWhen the restore completes, Dataproc Metastore automatically\nreturns to the [active state](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services?_gl=1*1qaoqiw*_ga*MTIzMTkxNzU5Ni4xNjYzNzk5NTI1*_ga_WH2QY8WWF5*MTY2MzgwMzk0MC4xOS4xLjE2NjM4MDQxNTAuMC4wLjA.#state) regardless of whether or not the restore\nsucceeded.\n\n### View restore history\n\nTo view the restore history of a Dataproc Metastore service in\nthe Google Cloud console, complete the following steps:\n\n1. In the Google Cloud console console, open the [Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services) page.\n2. In the navigation bar, click **Backup/Restore**.\n\n Your restore history appears in a table under **Restore**.\n\n The history displays up to the latest 25 restores you completed.\n\n Deleting a Dataproc Metastore service also deletes all\n associated restore history.\n\nTroubleshoot common issues\n--------------------------\n\n- [The service agent or user account doesn't have necessary permissions](/dataproc-metastore/docs/troubleshooting#backup-restore-user-permissions).\n- For more help solving common troubleshooting issues, see [Backup and restore error scenarios](/dataproc-metastore/docs/troubleshooting#backup-and-restore-error-scenarios).\n\nWhat's next\n-----------\n\n- [Back up metadata from a service](/dataproc-metastore/docs/backup-metadata)\n- [Update and delete a service](/dataproc-metastore/docs/manage-service)\n- [Hive Metastore](/dataproc-metastore/docs/hive-metastore)"]]