Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Beim Erstellen eines Dataproc-Clusters können Sie den Cluster in den Hadoop-Modus für hohe Verfügbarkeit versetzen, indem Sie die Anzahl der Master-Instanzen im Cluster angeben. Die Anzahl der Master kann nur bei der Clustererstellung angegeben werden.
Derzeit unterstützt Dataproc zwei Master-Konfigurationen:
1 Master (Standard, keine hohe Verfügbarkeit)
3 Master (Hadoop für hohe Verfügbarkeit)
Vergleich zwischen dem Hadoop-Standardmodus und dem Hadoop-Modus für hohe Verfügbarkeit
Compute Engine-Fehler: Im seltenen Fall eines unerwarteten Compute Engine-Fehlers wird die Dataproc-Instanz neu gestartet. Die Dataproc-Standardkonfiguration mit einem einzelnen Masterknoten ist für das Wiederherstellen und die Weiterverarbeitung von neuen Aufgaben im oben genannten Fall ausgelegt. Aktive Jobs schlagen jedoch fehl und müssen noch einmal versucht werden. Darüber hinaus ist HDFS erst wieder verfügbar, wenn der einzige NameNode nach einem Neustart wiederhergestellt wurde. Im Hochverfügbarkeitsmodus werden HDFS-Hochverfügbarkeit und YARN-Hochverfügbarkeit konfiguriert, um unterbrechungsfreie YARN- und HDFS-Vorgänge trotz möglicher Ausfälle/Neustarts einzelner Knoten zu ermöglichen.
Job-Treiber-Beenden: Beachten Sie, dass das Treiber-/Hauptprogramm der von Ihnen ausgeführten Jobs weiterhin einen Single Point of Failure darstellt, wenn die Richtigkeit des Jobs davon abhängt, dass das Treiberprogramm erfolgreich ausgeführt wird. Über Dataproc Jobs-API gesendete Jobs werden nicht als "hohe Verfügbarkeit" betrachtet und bei einem Ausfall des Master-Knotens, der die entsprechenden Job-Treiberprogramme ausführt, weiterhin beendet. Damit einzelne Jobs, die in einem Cloud Dataproc-Cluster für hohe Verfügbarkeit ausgeführt werden, gegen Ausfälle einzelner Knoten geschützt sind, muss der Job entweder 1) ohne ein synchrones Treiberprogramm ausgeführt werden, oder 2) das Treiberprogramm selbst in einem YARN-Container ausführen und so geschrieben sein, dass Neustarts von Treiberprogrammen unterstützt werden. Ein Beispiel dafür, wie neustartfähige Treiberprogramme in YARN-Containern zum Zweck der Fehlertoleranz ausgeführt werden können, finden Sie unter Spark unter YARN starten.
Zonenausfall: Wie bei allen Dataproc-Clustern befinden sich alle Knoten in einem Cluster für hohe Verfügbarkeit in derselben Zone. Wenn ein Ausfall alle Knoten in einer Zone betrifft, wird der Ausfall nicht behoben.
Instanznamen
Der Standardmaster heißt cluster-name-m; HA-Master heißen cluster-name-m-0, cluster-name-m-1, cluster-name-m-2.
Apache ZooKeeper
In einem Dataproc-Cluster für hohe Verfügbarkeit wird die Zookeeper-Komponente automatisch auf den dortigen Masterknoten installiert. Diese Masterknoten sind alle Bestandteil eines Zookeeper-Clusters, der automatisches Failover für andere Hadoop-Dienste ermöglicht.
HDFS
In einem standardmäßigen Dataproc-Cluster:
führt cluster-name-m Folgendes aus:
NameNode
Secondary NameNode
In einem Dataproc-Cluster für hohe Verfügbarkeit
führen cluster-name-m-0 und cluster-name-m-1 Folgendes aus:
Wählen Sie zum Erstellen eines HA-Clusters im Abschnitt „Cluster einrichten“ des Dataproc-Bereichs Cluster erstellen die Option „Hohe Verfügbarkeit“ (3 Master, N Worker) aus.
[[["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-09-04 (UTC)."],[[["\u003cp\u003eDataproc clusters can be configured in Hadoop High Availability (HA) mode by setting the number of master instances to 3 during cluster creation, as opposed to the default of 1.\u003c/p\u003e\n"],["\u003cp\u003eHA mode provides uninterrupted YARN and HDFS operations despite single-node failures or reboots, unlike the default mode where in-flight jobs may fail during a Compute Engine failure, necessitating job retries.\u003c/p\u003e\n"],["\u003cp\u003eJobs submitted through the Dataproc Jobs API are not considered "high availability" and will be terminated if the master node running the job driver fails; if a job requires high availability, it must be launched without a driver program, or the driver program must be launched within a YARN container.\u003c/p\u003e\n"],["\u003cp\u003eIn an HA cluster, all master nodes participate in a ZooKeeper cluster to enable automatic failover, and each node runs ResourceManager, while in a default cluster, the single master runs the NameNode, Secondary NameNode, and ResourceManager.\u003c/p\u003e\n"],["\u003cp\u003eCreating an HA cluster involves using either the gcloud command with \u003ccode\u003e--num-masters=3\u003c/code\u003e, the REST API by setting \u003ccode\u003emasterConfig.numInstances\u003c/code\u003e to \u003ccode\u003e3\u003c/code\u003e, or by selecting "High Availability (3 masters, N workers)" in the Dataproc console.\u003c/p\u003e\n"]]],[],null,["When creating a Dataproc cluster, you can put the cluster into\nHadoop High Availability (HA) mode by\nspecifying the number of master instances in the\ncluster. The number of masters can only be specified at cluster creation time.\n\nCurrently, Dataproc supports two master configurations:\n\n- 1 master (default, non HA)\n- 3 masters (Hadoop HA)\n\nComparison of default and Hadoop High Availability mode Due to the complexity and higher cost of HA mode, use the default mode unless your use case requires HA mode.\n\n- **Compute Engine failure:** In the rare case of an\n unexpected Compute Engine failure, Dataproc\n instances will experience a machine reboot. The default single-master\n configuration for Dataproc is designed to recover and continue processing\n new work in such cases, but in-flight jobs will necessarily fail and need to be\n retried, and HDFS will be inaccessible until the single NameNode fully recovers\n on reboot. In **HA mode** , [HDFS High Availability](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html) and\n [YARN High Availability](https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html)\n are configured to allow uninterrupted YARN and HDFS operations despite any\n single-node failures/reboots.\n\n- **Job driver termination:** The driver/main program of any jobs you run still represents a\n potential single point of failure if the correctness of your job depends on the\n driver program running successfully. Jobs submitted through the Dataproc\n Jobs API are not considered \"high availability,\" and will still be terminated on\n failure of the master node that runs the corresponding job driver programs. For\n individual jobs to be resilient against single-node failures using a HA Cloud\n Dataproc cluster, the job must either 1) run without a synchronous driver\n program or 2) it must run the driver program itself inside a YARN container and\n be written to handle driver-program restarts. See\n [Launching Spark on YARN](http://spark.apache.org/docs/latest/running-on-yarn.html#launching-spark-on-yarn) for an example\n of how restartable driver programs can run inside YARN containers for fault\n tolerance.\n\n- **Zonal failure:** As is the case with all Dataproc clusters, all nodes in a High\n Availability cluster reside in the same zone. If there is a failure that\n impacts all nodes in a zone, the failure will not be mitigated.\n\nInstance Names\n\nThe default master is named `cluster-name-m`; HA masters are named\n`cluster-name-m-0`, `cluster-name-m-1`, `cluster-name-m-2`.\n\nApache ZooKeeper\n\nIn an HA Dataproc cluster, the\n[Zookeeper component](/dataproc/docs/concepts/components/zookeeper)\nis automatically installed on cluster master nodes. All masters\nparticipate in a ZooKeeper cluster, which enables automatic failover for\nother Hadoop services.\n\nHDFS\n\nIn a standard Dataproc cluster:\n\n- `cluster-name-m` runs:\n - NameNode\n - Secondary NameNode\n\nIn a High Availability Dataproc cluster:\n\n- `cluster-name-m-0` and `cluster-name-m-1` run:\n - NameNode\n - ZKFailoverController\n- All masters run JournalNode\n- There is no Secondary NameNode\n\nPlease see the [HDFS High Availability](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html)\ndocumentation for additional details on components.\n\nYARN\n\nIn a standard Dataproc cluster, `cluster-name-m` runs ResourceManager.\n\nIn a High Availability Dataproc cluster, all masters run ResourceManager.\n\nPlease see the [YARN High Availability](https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html)\ndocumentation for additional details on components.\n\nCreate a High Availability cluster \n\ngcloud command\n\n\n| **gcloud CLI setup:** You must [setup and configure](/sdk/docs/quickstarts) the gcloud CLI to use the Google Cloud CLI.\nTo create an HA cluster with [gcloud dataproc clusters create](/sdk/gcloud/reference/dataproc/clusters/create), run the following command: \n\n```\ngcloud dataproc clusters create cluster-name \\\n --region=region \\\n --num-masters=3 \\\n ... other args\n```\n\n\u003cbr /\u003e\n\nREST API\n\n\nTo create an HA cluster, use the\n[clusters.create](/dataproc/docs/reference/rest/v1/projects.regions.clusters/create)\nAPI, setting [masterConfig.numInstances](/dataproc/docs/reference/rest/v1/ClusterConfig#InstanceGroupConfig)\nto `3`.\n| An easy way to construct the JSON body of an HA cluster create request is to create the request from the Dataproc [Create a cluster](https://console.cloud.google.com/dataproc/clustersAdd) page of the Google Cloud console. Select High Availability (3 masters, N workers) in the Cluster type section of the Set up cluster panel, then click the Equivalent REST button at the bottom of the left panel. Here's a snippet of a sample JSON output produced by the console for an HA cluster create request: \n|\n| ```\n| ...\n| masterConfig\": {\n| \"numInstances\": 3,\n| \"machineTypeUri\": \"n1-standard-4\",\n| \"diskConfig\": {\n| \"bootDiskSizeGb\": 500,\n| \"numLocalSsds\": 0\n| }\n| }\n| ...\n| ```\n\n\u003cbr /\u003e\n\nConsole\n\n\nTo create an HA cluster, select High Availability (3 masters, N workers) in\nthe Cluster type section of the Set up cluster panel on the\nDataproc\n[Create a cluster](https://console.cloud.google.com/dataproc/clustersAdd)\npage."]]