Dataproc Metastore aus einer Sicherung wiederherstellen
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 aus einer Sicherung wiederherstellen.
Eine Sicherung ist ein Snapshot der Konfigurationseinstellungen und Metadaten, die in einem Dataproc Metastore-Dienst gespeichert sind. Mit der Wiederherstellungsfunktion können Sie schnell einen neuen Dataproc Metastore-Dienst mit den Daten einrichten, die zuvor in einem Back-up gespeichert wurden.
Bitten Sie Ihren Administrator, Ihnen die folgenden IAM-Rollen zuzuweisen, um die Berechtigungen zu erhalten, die Sie zum Wiederherstellen eines Dataproc Metastore-Dienstes aus einem Backup benötigen:
Um die vollständige Kontrolle über Dataproc Metastore-Ressourcen zu gewähren, damit ein Back-up erstellt werden kann, muss entweder:
So verwenden Sie das Cloud Storage-Objekt, in dem geplante Sicherungen gespeichert werden:
Cloud Storage-Objekt-Nutzer (roles/storage.objectUser)
für den Dataproc Metastore-Dienst-Agent
Diese vordefinierten Rollen enthalten die Berechtigungen, die zum Wiederherstellen eines Dataproc Metastore-Dienstes aus einem Backup erforderlich sind. Erweitern Sie den Abschnitt Erforderliche Berechtigungen, um die erforderlichen Berechtigungen anzuzeigen:
Erforderliche Berechtigungen
Die folgenden Berechtigungen sind erforderlich, um einen Dataproc Metastore-Dienst aus einer Sicherung wiederherzustellen:
So stellen Sie einen Metadatendienst wieder her:
metastore.services.restore, metastore.backups.use
Wenn Sie einen Dienst aus einer Sicherung wiederherstellen, können Sie eine der folgenden Optionen auswählen:
Alle im Backup gespeicherten Metadaten und Konfigurationseinstellungen wiederherstellen.
Alle Metadaten wiederherstellen, aber nicht die im Backup gespeicherten Konfigurationseinstellungen. Stattdessen behält Ihr Dienst die aktuellen Konfigurationseinstellungen bei.
Konfigurationseinstellungen umfassen Dataproc Metastore-Parameter wie Dienstname, Portnummer und Netzwerkeinstellungen.
Metadaten umfassen alle Datenbank- und Tabelleninformationen, die in einem Dataproc Metastore-Dienst gespeichert sind.
Hinweise
Während ein Wiederherstellungsvorgang ausgeführt wird, können Sie Ihren Dienst nicht aktualisieren, z. B. keine Konfigurationseinstellungen ändern. Sie können den Dienst jedoch weiterhin für normale Vorgänge verwenden, z. B. um über angehängte Dataproc- oder selbstverwaltete Cluster auf die zugehörigen Metadaten zuzugreifen.
Dataproc Metastore-Labels werden nicht wiederhergestellt.
Daten, die im Warehouse-Verzeichnis gespeichert sind, werden nicht wiederhergestellt.
Beim Wiederherstellen aus einer Sicherung werden keine detaillierten IAM-Richtlinien wiederhergestellt oder ersetzt.
Wenn Sie eine Wiederherstellung aus einer geplanten Sicherung durchführen möchten, muss sich die Sicherung in einem Cloud Storage-Bucket befinden.
Aus einer Sicherung wiederherstellen
Führen Sie die folgenden Schritte aus, um einen Dataproc Metastore-Dienst aus einer Sicherung wiederherzustellen.
Wenn Sie die Google Cloud -Konsole verwenden, können Sie Metadaten nur aus einer Sicherung wiederherstellen, die im selben Projekt und in derselben Region wie Ihr neuer Dienst erstellt wurde.
Wenn Sie die Google Cloud CLI oder Dataproc Metastore APIs verwenden, können Sie Metadaten aus einer Sicherung wiederherstellen, die in einem anderen Projekt und einer anderen Region erstellt wurde (dienstübergreifende Sicherung).
Console
Öffnen Sie in der Google Cloud Console die Seite Dataproc Metastore:
Klicken Sie auf der Seite Dataproc Metastore auf den Namen des Dienstes, den Sie aus einer Sicherung wiederherstellen möchten.
Die Seite Dienstdetails wird geöffnet.
Abbildung 1. Die Detailseite des Dataproc Metastore-Dienstes
Klicken Sie auf den Tab Sicherung/Wiederherstellung, um Ihre Sicherungen aufzurufen.
Wählen Sie die Sicherung aus, die Sie verwenden möchten. Klicken Sie dazu auf das Menüsymbol more_vert und wählen Sie Wiederherstellen aus.
Die Seite Wiederherstellen wird geöffnet.
Sie können Ihren Dienst auch auf der Seite Sicherungsdetails wiederherstellen.
Klicken Sie dazu auf den Namen der Sicherung und dann auf Wiederherstellen.
Wählen Sie den gewünschten Wiederherstellungsvorgang aus:
Metastore-Daten wiederherstellen Stellt alle Metadaten wieder her, aber nicht die im Backup gespeicherten Konfigurationseinstellungen
Metastore-Daten und Dienstkonfiguration wiederherstellen
Stellt alle im Backup gespeicherten Metadaten und Konfigurationseinstellungen wieder her.
Klicken Sie zum Aktualisieren des Dienstes auf Wiederherstellen.
Kehren Sie zur Seite Dataproc Metastore zurück und prüfen Sie, ob Ihr Dienst erfolgreich gesichert wurde.
Wenn die Wiederherstellung abgeschlossen ist, wechselt Dataproc Metastore automatisch wieder in den aktiven Status, unabhängig davon, ob die Wiederherstellung erfolgreich war oder nicht.
SERVICE: der Name Ihres Dataproc Metastore-Dienstes.
PROJECT_ID: Die Projekt-ID des Google Cloud-Projekts, in dem sich Ihr Dataproc Metastore-Dienst befindet.
LOCATION: die Google Cloud Region, in der sich Ihr Dataproc Metastore-Dienst befindet.
BACKUP: Optional: die ID der Sicherungsdatei, aus der Sie wiederherstellen. Dieser Wert kann die Sicherungs-ID, eine vollständig qualifizierte URL oder der relative Name im folgenden Format sein: projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}.
RESTORE_TYPE: Der Typ des auszuführenden Wiederherstellungsvorgangs.
Zulässige Werte sind metadata-only und full. Der Standardwert ist metadata-only.
BACKUP_LOCATION (Optional): Der Cloud Storage-Speicherort Ihres geplanten Backups.
Beispiel: gs://my-bucket/path/to/location
Prüfen Sie, ob der Wiederherstellungsvorgang erfolgreich war.
Wenn die Wiederherstellung abgeschlossen ist, wechselt Dataproc Metastore automatisch wieder in den aktiven Status, unabhängig davon, ob die Wiederherstellung erfolgreich war oder nicht.
Wenn die Wiederherstellung abgeschlossen ist, wechselt Dataproc Metastore automatisch in den aktiven Status, unabhängig davon, ob die Wiederherstellung erfolgreich war oder nicht.
Wiederherstellungsverlauf ansehen
So rufen Sie den Wiederherstellungsverlauf eines Dataproc Metastore-Dienstes in der Google Cloud -Konsole auf:
[[["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 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)"]]